@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.
@@ -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 c = ss.charAt(0);
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(c);
3886
+ let ci = cs.indexOf(char);
3887
3887
  if (ci != -1) {
3888
- let bracketStack = [c];
3888
+ let bracketStack = [char];
3889
3889
  for (let i = 1; i < ss.length; i++) {
3890
- const char = ss[i];
3891
- if (cs.includes(char)) {
3892
- bracketStack.push(char);
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;
@@ -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 c = ss.charAt(0);
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(c);
3868
+ let ci = cs.indexOf(char);
3869
3869
  if (ci != -1) {
3870
- let bracketStack = [c];
3870
+ let bracketStack = [char];
3871
3871
  for (let i = 1; i < ss.length; i++) {
3872
- const char = ss[i];
3873
- if (cs.includes(char)) {
3874
- bracketStack.push(char);
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/html/getVueText");require("@fangzhongya/utils/judge/matchsStart");require("@fangzhongya/utils/judge/matchsEnd");const o=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function x(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]];const t=l.map(a=>a[0]);if(t.indexOf(r)!=-1){let a=[r];for(let n=1;n<e.length;n++){const p=e[n];if(t.includes(p))a.push(p);else{let f=!1;for(let m of l)if(p===m[1]&&a[a.length-1]===m[0]){f=!0;break}f&&a.pop()}if(a.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,r=e.name,l=e.description,t=e.default,i="",a="";if(s=="default")r=r.trim(),r=x(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const f=r.split("=");r=f[0];const m=f[1]+" "+l,g=x(m,!0);g?(t=g,l=m.replace(g,"")):t=e.default||f[1]||""}const p=/\s*\((.*)\)\s/gi.exec(l);p&&p.length>0&&(i=p[1],l=l.replace(p[0],""))}return r.endsWith("*")&&(a="*",r=r.substring(0,r.length-1)),e.name=r,e.required=a,e.default=t||"",e.description=l,e.selectable=i,e}function O(e){let s=["title","text","author","date"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),h(l),r.arr.forEach(t=>{b(t.key,t.value)})}function h(e){c.titles.push(e)}function T(e){let s=["props","name","type","default","required","selectable","description","descriptions","return"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),u(l,"props"),r.arr.forEach(t=>{b(t.key,t.value)})}function y(e){let s=["slot","name","selectable","description","descriptions"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),u(l,"slot"),r.arr.forEach(t=>{b(t.key,t.value)})}function k(e){let s=["emits","name","selectable","description","descriptions"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),u(l,"emits"),r.arr.forEach(t=>{b(t.key,t.value)})}function j(e){let s=["expose","name","type","return","selectable","description","descriptions"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),u(l,"expose"),r.arr.forEach(t=>{b(t.key,t.value)})}function u(e,s){const r=c[s+"name"]||[],l=e.name??e[s]?.name,t=r.indexOf(l);t>=0&&(c[s+"s"].splice(t,1),r.splice(t,1)),c[s+"s"].push(e),r.push(l),c[s+"name"]=r}function S(){Object.keys(c).forEach(e=>{c[e]=[]})}function d(e,s){const r={descriptions:e?.description||""},l=[];return e?.tags&&e.tags?.forEach(t=>{let i=t.tag,a=E(t);if(!r.hasOwnProperty(i))r[i]=a;else{const n={};n[i]=a,l.push({key:i,value:n})}}),{arr:l,obj:r}}function b(e,s){switch(e){case"title":return h(s),!0;case"text":return h(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 r=s?.tags||[],l=r?.length||0;if(l>0)for(let t=0;t<l;t++){const i=r[t]||{};if(w(i.tag,s))break}}),c}function P(e){let s=q.getTextNotes(e);return N(s)}const F=[{label:"属性名",prop:"name",formatter:o.props.name},{label:"说明",prop:"description",formatter:o.props.description},{label:"类型",prop:"type",formatter:o.props.type},{label:"可选值",prop:"selectable",formatter:o.props.selectable},{label:"默认值",prop:"default",formatter:o.props.default},{label:"必传",prop:"required",formatter:o.props.required},{label:"方法返回值",prop:"return",formatter:o.props.return}],v=[{label:"事件名",prop:"name",formatter:o.emits.name},{label:"说明",prop:"description",formatter:o.emits.description},{label:"回调参数",prop:"selectable",formatter:o.emits.selectable}],z=[{label:"方法名",prop:"name",formatter:o.expose.name},{label:"说明",prop:"description",formatter:o.expose.description},{label:"参数",prop:"selectable",formatter:o.expose.selectable},{label:"返回值",prop:"return",formatter(e){return o.expose.return(e)||e.expose.default||""}},{label:"类型",prop:"type",formatter(e){return o.expose.type(e)||"function"}}],A=[{label:"插槽名",prop:"name",formatter:o.slot.name},{label:"说明",prop:"description",formatter:o.slot.description},{label:"作用域参数",prop:"selectable",formatter:o.slot.selectable}];exports.getNotesText=P;exports.temits=v;exports.texpose=z;exports.tprops=F;exports.tslot=A;
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 u, emits as x, expose as d, slot as E } from "../../utils/props.js";
17
- const p = {
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 r = e.charAt(0), s = [
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 t = s.map((o) => o[0]);
34
- if (t.indexOf(r) != -1) {
35
- let o = [r];
36
- for (let n = 1; n < e.length; n++) {
37
- const i = e[n];
38
- if (t.includes(i))
39
- o.push(i);
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 f = !1;
42
- for (let m of s)
43
- if (i === m[1] && o[o.length - 1] === m[0]) {
44
- f = !0;
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
- f && o.pop();
47
+ c && o.pop();
48
48
  }
49
49
  if (o.length === 0)
50
- return l && e[n + 1] === " ", e.substring(0, n + 1);
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, r = e.name, s = e.description, t = e.default, a = "", o = "";
57
+ let l = e.tag, t = e.name, s = e.description, r = e.default, a = "", o = "";
58
58
  if (l == "default")
59
- r = r.trim(), r = k(r) || r;
59
+ t = t.trim(), t = k(t) || t;
60
60
  else if (l == "selectable")
61
- r = r.trim();
61
+ t = t.trim();
62
62
  else {
63
- if (r.includes("=")) {
64
- const f = r.split("=");
65
- r = f[0];
66
- const m = f[1] + " " + s, g = k(m, !0);
67
- g ? (t = g, s = m.replace(g, "")) : t = e.default || f[1] || "";
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 i = /\s*\((.*)\)\s/gi.exec(s);
70
- i && i.length > 0 && (a = i[1], s = s.replace(i[0], ""));
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 r.endsWith("*") && (o = "*", r = r.substring(0, r.length - 1)), e.name = r, e.required = o, e.default = t || "", e.description = s, e.selectable = a, e;
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
- ], r = b(e), s = {};
84
- l.forEach((t) => {
85
- s[t] = r.obj[t];
86
- }), O(s), r.arr.forEach((t) => {
87
- h(t.key, t.value);
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 O(e) {
91
- p.titles.push(e);
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
- ], r = b(e), s = {};
105
- l.forEach((t) => {
106
- s[t] = r.obj[t];
107
- }), c(s, "props"), r.arr.forEach((t) => {
108
- h(t.key, t.value);
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"], r = b(e), s = {};
113
- l.forEach((t) => {
114
- s[t] = r.obj[t];
115
- }), c(s, "slot"), r.arr.forEach((t) => {
116
- h(t.key, t.value);
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"], r = b(e), s = {};
121
- l.forEach((t) => {
122
- s[t] = r.obj[t];
123
- }), c(s, "emits"), r.arr.forEach((t) => {
124
- h(t.key, t.value);
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
- ], r = b(e), s = {};
137
- l.forEach((t) => {
138
- s[t] = r.obj[t];
139
- }), c(s, "expose"), r.arr.forEach((t) => {
140
- h(t.key, t.value);
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 c(e, l) {
144
- const r = p[l + "name"] || [], s = e.name ?? e[l]?.name, t = r.indexOf(s);
145
- t >= 0 && (p[l + "s"].splice(t, 1), r.splice(t, 1)), p[l + "s"].push(e), r.push(s), p[l + "name"] = r;
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(p).forEach((e) => {
149
- p[e] = [];
148
+ Object.keys(n).forEach((e) => {
149
+ n[e] = [];
150
150
  });
151
151
  }
152
- function b(e, l) {
153
- const r = {
152
+ function d(e, l) {
153
+ const t = {
154
154
  descriptions: e?.description || ""
155
155
  }, s = [];
156
- return e?.tags && e.tags?.forEach((t) => {
157
- let a = t.tag, o = q(t);
158
- if (!r.hasOwnProperty(a))
159
- r[a] = o;
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 n = {};
162
- n[a] = o, s.push({
161
+ const i = {};
162
+ i[a] = o, s.push({
163
163
  key: a,
164
- value: n
164
+ value: i
165
165
  });
166
166
  }
167
167
  }), {
168
168
  arr: s,
169
- obj: r
169
+ obj: t
170
170
  };
171
171
  }
172
- function h(e, l) {
172
+ function b(e, l) {
173
173
  switch (e) {
174
174
  case "title":
175
- return O(l), !0;
175
+ return E(l), !0;
176
176
  case "text":
177
- return O(l), !0;
177
+ return E(l), !0;
178
178
  case "props":
179
- return c(l, "props"), !0;
179
+ return p(l, "props"), !0;
180
180
  case "slot":
181
- return c(l, "slot"), !0;
181
+ return p(l, "slot"), !0;
182
182
  case "emits":
183
- return c(l, "emits"), !0;
183
+ return p(l, "emits"), !0;
184
184
  case "expose":
185
- return c(l, "expose"), !0;
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 r = l?.tags || [], s = r?.length || 0;
208
+ let t = l?.tags || [], s = t?.length || 0;
209
209
  if (s > 0)
210
- for (let t = 0; t < s; t++) {
211
- const a = r[t] || {};
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
- }), p;
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: u.name
225
+ formatter: f.name
226
226
  },
227
227
  {
228
228
  label: "说明",
229
229
  prop: "description",
230
- formatter: u.description
230
+ formatter: f.description
231
231
  },
232
232
  {
233
233
  label: "类型",
234
234
  prop: "type",
235
- formatter: u.type
235
+ formatter: f.type
236
236
  },
237
237
  {
238
238
  label: "可选值",
239
239
  prop: "selectable",
240
- formatter: u.selectable
240
+ formatter: f.selectable
241
241
  },
242
242
  {
243
243
  label: "默认值",
244
244
  prop: "default",
245
- formatter: u.default
245
+ formatter: f.default
246
246
  },
247
247
  {
248
248
  label: "必传",
249
249
  prop: "required",
250
- formatter: u.required
250
+ formatter: f.required
251
251
  },
252
252
  {
253
253
  label: "方法返回值",
254
254
  prop: "return",
255
- formatter: u.return
255
+ formatter: f.return
256
256
  }
257
257
  ], X = [
258
258
  {
259
259
  label: "事件名",
260
260
  prop: "name",
261
- formatter: x.name
261
+ formatter: g.name
262
262
  },
263
263
  {
264
264
  label: "说明",
265
265
  prop: "description",
266
- formatter: x.description
266
+ formatter: g.description
267
267
  },
268
268
  {
269
269
  label: "回调参数",
270
270
  prop: "selectable",
271
- formatter: x.selectable
271
+ formatter: g.selectable
272
272
  }
273
273
  ], Y = [
274
274
  {
275
275
  label: "方法名",
276
276
  prop: "name",
277
- formatter: d.name
277
+ formatter: m.name
278
278
  },
279
279
  {
280
280
  label: "说明",
281
281
  prop: "description",
282
- formatter: d.description
282
+ formatter: m.description
283
283
  },
284
284
  {
285
285
  label: "参数",
286
286
  prop: "selectable",
287
- formatter: d.selectable
287
+ formatter: m.selectable
288
288
  },
289
289
  {
290
290
  label: "返回值",
291
291
  prop: "return",
292
292
  formatter(e) {
293
- return d.return(e) || e.expose.default || "";
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 d.type(e) || "function";
300
+ return m.type(e) || "function";
301
301
  }
302
302
  }
303
303
  ], Z = [
304
304
  {
305
305
  label: "插槽名",
306
306
  prop: "name",
307
- formatter: E.name
307
+ formatter: x.name
308
308
  },
309
309
  {
310
310
  label: "说明",
311
311
  prop: "description",
312
- formatter: E.description
312
+ formatter: x.description
313
313
  },
314
314
  {
315
315
  label: "作用域参数",
316
316
  prop: "selectable",
317
- formatter: E.selectable
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)]),_:1},8,["value"]),e.createElementVNode("div",{innerHTML:n.value},null,8,m)],64)):e.createCommentVNode("",!0)]))}});module.exports=h;
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;
@@ -42,7 +42,7 @@ const y = { class: "md" }, L = { class: "md-top-name" }, T = ["innerHTML"], D =
42
42
  value: e.value
43
43
  }, {
44
44
  default: p(() => [
45
- l("div", L, g(e.value?.value) + " 说明文档 ", 1)
45
+ l("div", L, g(e.value?.value) + " 说明文档", 1)
46
46
  ]),
47
47
  _: 1
48
48
  }, 8, ["value"]),
@@ -1,18 +1,25 @@
1
- import { ObjStr, ObjUnk } from '../../config';
2
- import { SpecObjs, Spec } from '../../utils/index';
3
- import { DataType } from './util';
4
- export declare function getHmtl(propsname: string, param: {
5
- [key: string]: SpecObjs[];
6
- }, value: ObjUnk, slotValue?: ObjStr, propsText?: ObjStr, exposeText?: ObjUnk): Promise<string>;
7
- export declare function setValStringify(v: unknown, key: string, propsText?: ObjStr): string | Promise<string>;
8
- type SelectsObj = {
9
- label: string;
10
- prop: unknown;
11
- };
12
- export declare function getSpecType(val: Spec): {
13
- arr: SelectsObj[];
14
- type: string;
15
- dataType: DataType[];
16
- };
17
- export declare function getDefaultValue(obj: Spec, is?: boolean): any;
18
- export {};
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../vue/dist/vue.esm-bundler.js';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ name: {
4
+ type: StringConstructor;
5
+ };
6
+ html: {
7
+ type: StringConstructor;
8
+ default(): string;
9
+ };
10
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
11
+ refresh: (...args: any[]) => void;
12
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
13
+ name: {
14
+ type: StringConstructor;
15
+ };
16
+ html: {
17
+ type: StringConstructor;
18
+ default(): string;
19
+ };
20
+ }>> & Readonly<{
21
+ onRefresh?: ((...args: any[]) => any) | undefined;
22
+ }>, {
23
+ html: string;
24
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
25
+ export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=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");const r={components:[]};function u(e){return i.mergeObject(r,e,2)}function n(e){return r[e]}exports.getConfig=n;exports.userConfig=u;
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;
@@ -1,24 +1,14 @@
1
- import { mergeObject as r } from "@fangzhongya/utils/basic/object/mergeObject";
2
- import "@fangzhongya/utils/basic/array/toggleArray";
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 b(o) {
16
- return r(t, o, 2);
5
+ function r(n) {
6
+ return t(o, n, 2);
17
7
  }
18
- function j(o) {
19
- return t[o];
8
+ function c(n) {
9
+ return o[n];
20
10
  }
21
11
  export {
22
- j as getConfig,
23
- b as userConfig
12
+ c as getConfig,
13
+ r as userConfig
24
14
  };
@@ -1,5 +1,5 @@
1
1
  import { Config } from '../config';
2
- import { ComponentsObj, TextObj } from '../utils/common';
2
+ import { ComponentsObj, TextObj } from '../utils/type';
3
3
  interface NodeConfig extends Config {
4
4
  [key: string]: any;
5
5
  }
@@ -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 a, openBlock as t, withDirectives as m, createElementVNode as e, createVNode as d, unref as u, createBlock as v } from "vue";
2
- import f from "../../directives/adjust/index.js";
3
- import h from "../../components/aside/index.vue.js";
4
- import p from "../../components/header/index.vue.js";
5
- import x from "../../components/main/index.vue.js";
6
- import { getCompoName as g } from "../../utils/glob.js";
7
- import { useRoute as y } from "vue-router";
8
- const k = { class: "__document-index" }, C = { class: "index-aside" }, q = { class: "index-aside-div" }, B = { class: "index-body" }, N = { class: "index-div" }, w = { class: "index-header" }, D = { class: "index-main" }, E = { class: "index-main-div" }, G = /* @__PURE__ */ r({
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(V) {
11
- const o = y(), i = _({});
10
+ setup($) {
11
+ const i = k(), o = _({});
12
12
  function c(s) {
13
- i.value = s;
13
+ o.value = s;
14
14
  }
15
15
  l(
16
- () => o.query?.id,
16
+ () => i.query?.id,
17
17
  () => {
18
18
  n();
19
19
  }
20
20
  );
21
21
  function n() {
22
- o.query?.id && (i.value = g(o.query.id + "")[0]);
22
+ i.query?.id && (o.value = y(i.query.id + "")[0] || {});
23
23
  }
24
- return n(), (s, $) => (t(), a("div", k, [
25
- m((t(), a("div", C, [
26
- e("div", q, [
27
- d(h, {
28
- value: i.value,
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
- [u(f), {
35
+ [v(h), {
34
36
  right: {}
35
37
  }]
36
38
  ]),
37
- e("div", B, [
38
- e("div", N, [
39
- e("div", w, [
40
- d(p)
41
- ]),
39
+ e("div", N, [
40
+ e("div", w, [
42
41
  e("div", D, [
43
- e("div", E, [
44
- (t(), v(x, {
45
- key: i.value?.name,
46
- value: i.value
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.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
+ "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/common';
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.name + "/" + e.value
71
+ id: e?.name + "/" + e?.value
72
72
  },
73
- params: { key: e.key, comkey: e.comkey }
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.value
80
+ id: e?.value
81
81
  },
82
- params: { key: e.key }
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.value
89
+ id: e?.value
90
90
  },
91
- params: { key: e.key }
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.value
98
+ id: e?.value
99
99
  },
100
- params: { key: e.key }
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.value
107
+ id: e?.value
108
108
  },
109
- params: { key: e.key }
109
+ params: { key: e?.key }
110
110
  });
111
111
  }
112
112
  export {
@@ -1,70 +1,10 @@
1
- import { AsyncComponentLoader } from '../../vue/dist/vue.esm-bundler.js';
2
- import { Component, Components, Globs, GlobComs, GetRaw, FangMatch } from '../config';
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
@@ -1,4 +1,4 @@
1
- import { PropsObj, ComponentsObj, TestsObj, TextObj, MdObj, PropObj } from './common';
1
+ import { PropsObj, ComponentsObj, TestsObj, TextObj, MdObj, PropObj } from './type';
2
2
  /**
3
3
  * 通过文件对象读取文件
4
4
  * @param {*} obj
@@ -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
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.82",
4
+ "version": "0.0.84",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",