@fangzhongya/vue-archive 0.0.64 → 0.0.66

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.
@@ -1043,7 +1043,15 @@ function isMatchexts(url, matchs, nomatchs) {
1043
1043
  return is;
1044
1044
  }
1045
1045
  }
1046
- function checkSuffixBeforeMatch(str, regex) {
1046
+ function checkSuffixBeforeMatch(str, regex, suffix) {
1047
+ regex.lastIndex = 0;
1048
+ const match = regex.exec(str);
1049
+ if (!match) return false;
1050
+ const matchStartIndex = match.index;
1051
+ const beforeMatch = str.substring(0, matchStartIndex);
1052
+ return beforeMatch.endsWith(suffix);
1053
+ }
1054
+ function checkBeforeMatch(str, regex) {
1047
1055
  regex.lastIndex = 0;
1048
1056
  const match = regex.exec(str);
1049
1057
  if (!match) return "";
@@ -1069,7 +1077,7 @@ function getUrlsMatchi(key, matchs) {
1069
1077
  }
1070
1078
  }
1071
1079
  } else {
1072
- const v = checkSuffixBeforeMatch(key, value);
1080
+ const v = checkBeforeMatch(key, value);
1073
1081
  if (v) {
1074
1082
  const reg = new RegExp("^.*/([^/]+)$");
1075
1083
  let ms = v.match(reg);
@@ -1121,6 +1129,40 @@ function getComponentsObj(key, config2, tdir) {
1121
1129
  return rsobj;
1122
1130
  }
1123
1131
  }
1132
+ function isUrlsMatchi(key, arr, matchs) {
1133
+ for (const name of arr) {
1134
+ const t = "/" + name;
1135
+ if (matchs && matchs.length > 0) {
1136
+ for (const value of matchs) {
1137
+ if (typeof value == "string") {
1138
+ if (key.endsWith(t + value)) {
1139
+ return true;
1140
+ }
1141
+ } else {
1142
+ if (checkSuffixBeforeMatch(key, value, t)) {
1143
+ return true;
1144
+ }
1145
+ }
1146
+ }
1147
+ } else {
1148
+ const v = key.includes(name);
1149
+ if (v) {
1150
+ return true;
1151
+ }
1152
+ }
1153
+ }
1154
+ return false;
1155
+ }
1156
+ function getMatchsUrl(urls, name, _type, config2) {
1157
+ const ms = [];
1158
+ const m = config2.matchextss;
1159
+ if (m) {
1160
+ ms.push(m);
1161
+ }
1162
+ return urls.filter((v) => {
1163
+ return isUrlsMatchi(v, [name], ms);
1164
+ })[0] || "";
1165
+ }
1124
1166
  function getUrlName(url, config2, urls, key, tdir) {
1125
1167
  if (isMatchDir(url, config2.matchs, config2.nomatchs)) {
1126
1168
  let is = false;
@@ -1131,20 +1173,16 @@ function getUrlName(url, config2, urls, key, tdir) {
1131
1173
  }
1132
1174
  if (is) {
1133
1175
  const getUrl = config2.getMatchs;
1176
+ const name = getUrlsMatchi(key, config2.matchexts);
1134
1177
  if (getUrl) {
1135
- const v = getUrl(urls, "", "", config2);
1178
+ const v = getUrl(urls, name, "component", config2);
1136
1179
  return getComponentsObj(v, config2, tdir);
1137
1180
  } else {
1138
1181
  const ms = config2.matchextss;
1139
1182
  if (ms) {
1140
- if (typeof ms == "string") {
1141
- if (url.endsWith(ms)) {
1142
- return getComponentsObj(key, config2, tdir);
1143
- }
1144
- } else {
1145
- if (ms.test(url)) {
1146
- return getComponentsObj(key, config2, tdir);
1147
- }
1183
+ const v = getMatchsUrl([key], name, "component", config2) || getMatchsUrl(urls, name, "component", config2);
1184
+ if (v) {
1185
+ return getComponentsObj(v, config2, tdir);
1148
1186
  }
1149
1187
  } else {
1150
1188
  return getComponentsObj(key, config2, tdir);
@@ -1028,7 +1028,15 @@ function isMatchexts(url, matchs, nomatchs) {
1028
1028
  return is;
1029
1029
  }
1030
1030
  }
1031
- function checkSuffixBeforeMatch(str, regex) {
1031
+ function checkSuffixBeforeMatch(str, regex, suffix) {
1032
+ regex.lastIndex = 0;
1033
+ const match = regex.exec(str);
1034
+ if (!match) return false;
1035
+ const matchStartIndex = match.index;
1036
+ const beforeMatch = str.substring(0, matchStartIndex);
1037
+ return beforeMatch.endsWith(suffix);
1038
+ }
1039
+ function checkBeforeMatch(str, regex) {
1032
1040
  regex.lastIndex = 0;
1033
1041
  const match = regex.exec(str);
1034
1042
  if (!match) return "";
@@ -1054,7 +1062,7 @@ function getUrlsMatchi(key, matchs) {
1054
1062
  }
1055
1063
  }
1056
1064
  } else {
1057
- const v = checkSuffixBeforeMatch(key, value);
1065
+ const v = checkBeforeMatch(key, value);
1058
1066
  if (v) {
1059
1067
  const reg = new RegExp("^.*/([^/]+)$");
1060
1068
  let ms = v.match(reg);
@@ -1106,6 +1114,40 @@ function getComponentsObj(key, config2, tdir) {
1106
1114
  return rsobj;
1107
1115
  }
1108
1116
  }
1117
+ function isUrlsMatchi(key, arr, matchs) {
1118
+ for (const name of arr) {
1119
+ const t = "/" + name;
1120
+ if (matchs && matchs.length > 0) {
1121
+ for (const value of matchs) {
1122
+ if (typeof value == "string") {
1123
+ if (key.endsWith(t + value)) {
1124
+ return true;
1125
+ }
1126
+ } else {
1127
+ if (checkSuffixBeforeMatch(key, value, t)) {
1128
+ return true;
1129
+ }
1130
+ }
1131
+ }
1132
+ } else {
1133
+ const v = key.includes(name);
1134
+ if (v) {
1135
+ return true;
1136
+ }
1137
+ }
1138
+ }
1139
+ return false;
1140
+ }
1141
+ function getMatchsUrl(urls, name, _type, config2) {
1142
+ const ms = [];
1143
+ const m = config2.matchextss;
1144
+ if (m) {
1145
+ ms.push(m);
1146
+ }
1147
+ return urls.filter((v) => {
1148
+ return isUrlsMatchi(v, [name], ms);
1149
+ })[0] || "";
1150
+ }
1109
1151
  function getUrlName(url, config2, urls, key, tdir) {
1110
1152
  if (isMatchDir(url, config2.matchs, config2.nomatchs)) {
1111
1153
  let is = false;
@@ -1116,20 +1158,16 @@ function getUrlName(url, config2, urls, key, tdir) {
1116
1158
  }
1117
1159
  if (is) {
1118
1160
  const getUrl = config2.getMatchs;
1161
+ const name = getUrlsMatchi(key, config2.matchexts);
1119
1162
  if (getUrl) {
1120
- const v = getUrl(urls, "", "", config2);
1163
+ const v = getUrl(urls, name, "component", config2);
1121
1164
  return getComponentsObj(v, config2, tdir);
1122
1165
  } else {
1123
1166
  const ms = config2.matchextss;
1124
1167
  if (ms) {
1125
- if (typeof ms == "string") {
1126
- if (url.endsWith(ms)) {
1127
- return getComponentsObj(key, config2, tdir);
1128
- }
1129
- } else {
1130
- if (ms.test(url)) {
1131
- return getComponentsObj(key, config2, tdir);
1132
- }
1168
+ const v = getMatchsUrl([key], name, "component", config2) || getMatchsUrl(urls, name, "component", config2);
1169
+ if (v) {
1170
+ return getComponentsObj(v, config2, tdir);
1133
1171
  }
1134
1172
  } else {
1135
1173
  return getComponentsObj(key, config2, tdir);
@@ -1,25 +1,17 @@
1
- import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../vue/dist/vue.esm-bundler.js';
2
- declare const _default: DefineComponent<ExtractPropTypes<{
3
- name: {
4
- type: StringConstructor;
5
- };
6
- html: {
7
- type: StringConstructor;
8
- default(): string;
9
- };
10
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
11
- refresh: (...args: any[]) => void;
12
- }, string, PublicProps, Readonly< ExtractPropTypes<{
13
- name: {
14
- type: StringConstructor;
15
- };
16
- html: {
17
- type: StringConstructor;
18
- default(): string;
19
- };
20
- }>> & Readonly<{
21
- onRefresh?: ((...args: any[]) => any) | undefined;
22
- }>, {
23
- html: string;
24
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
25
- export default _default;
1
+ import { ObjStr, ObjUnk } from '../../config';
2
+ import { SpecObjs, Spec } from '../../utils/index';
3
+ export declare function getHmtl(propsname: string, param: {
4
+ [key: string]: SpecObjs[];
5
+ }, value: ObjUnk, slotValue?: ObjStr, propsText?: ObjStr, exposeText?: ObjUnk): string;
6
+ export declare function setValStringify(v: unknown, key: string, propsText?: ObjStr): string;
7
+ type SelectsObj = {
8
+ label: string;
9
+ prop: unknown;
10
+ };
11
+ export declare function getSpecType(val: Spec): {
12
+ arr: SelectsObj[];
13
+ type: string;
14
+ dataType: string[];
15
+ };
16
+ export declare function getDefaultValue(obj: Spec, is?: boolean): any;
17
+ export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./storage.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const A=require("@fangzhongya/utils/name/humpToLine"),C=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");const q=require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const m=require("@fangzhongya/utils/judge/matchsStart"),h=require("@fangzhongya/utils/judge/matchsEnd"),N=["vue","js","ts"];function R(t){let e=A.humpToLine(t.name),r=[];return t.alias&&r.push(t.alias+"-"+e),r}function $(t,e,r){const s=m.matchsStart(t,e);return s&&r&&r.length>0?!m.matchsStart(t,r):s}function O(t,e,r){const s=h.matchsEnd(t,e);return s&&r&&r.length>0?!h.matchsEnd(t,r):s}function T(t,e){e.lastIndex=0;const r=e.exec(t);if(!r)return"";const s=r.index;return t.substring(0,s)}function z(t){const e=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`${e(t)}$`)}function x(t,e){if(e&&e.length>0)for(const r of e)if(typeof r=="string"){if(t.endsWith(r)){const s=t.replace(z(r),"");if(s){const a=new RegExp("^.*/([^/]+)$");let u=s.match(a);if(u)return u[1]}}}else{const s=T(t,r);if(s){const a=new RegExp("^.*/([^/]+)$");let u=s.match(a);if(u)return u[1]}}return""}function c(t,e,r){const s=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let a=t.indexOf(s),u=e.dir.substring(0,e.dir.indexOf(s))+t.substring(a),l="";if(e.getNameValue)l=e.getNameValue(t,e);else{const n=e.matchextss;n?l=x(t,[n]):l=x(t,e.matchexts)}if(l){let n={suffix:q.getSuffix(t),name:C.lineToLargeHump(l),value:l,adir:"",alias:e.alias,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0,url:u,comprops:e.comprops,curprops:e.curprops,dir:e.dir,cwd:e.cwd,tdir:r,key:t};return n.aliasNames=R(n),n}}function S(t,e,r,s,a){if($(t,e.matchs,e.nomatchs)){let u=!1;if(e.isMatch?u=e.isMatch(t,"",[],e):u=O(t,e.matchexts,e.nomatchexts),u){const l=e.getMatchs;if(l){const n=l(r,"","",e);return c(n,e,a)}else{const n=e.matchextss;if(n){if(typeof n=="string"){if(t.endsWith(n))return c(s,e,a)}else if(n.test(t))return c(s,e,a)}else return c(s,e,a)}}}}function K(t){g.setSession("aside.key",t)}function L(){return g.getSession("aside.key")}function U(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function w(t,e){if(e)for(let r=0;r<e.length;r++){const s=e[r];if(typeof s=="string"){if(t.includes(s))return!0}else if(s.test(t))return!0}return!1}function E(t,e){if(e)for(let r=0;r<e.length;r++){const s=e[r];if(typeof s=="string"){if(t.endsWith(s))return!0}else if(s.test(t))return!0}return!1}function V(t,e,r,s){const a=[],u=[],l=U(e.dir);return t.forEach(n=>{const p=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let M=n.indexOf(p),d=e.dir.substring(0,e.dir.indexOf(p))+n.substring(M);const b=new RegExp("^"+e.dir);let o=d.replace(b,"");if(e.comprops&&w("/"+o,e.comprops)||e.curprops&&E("/"+o,e.curprops)){let i={};i.url=d,i.comprops=e.comprops,i.curprops=e.curprops,i.value=o,i.dir=e.dir,i.cwd=e.cwd,i.suffix=q.getSuffix(n),i.tdir=l,i.key=n,i.raw="",i.getRaw=f(r,n),a.push(i)}else{let i=S(o,e,t,n,l);i&&(i.component=s[i.key],i.getRaw=f(r,i.key),u.push(i))}}),{props:a,components:u}}function f(t,e){return typeof t=="function"?t:t?t[e]:null}exports.defaultExtensions=N;exports.getAsideKey=L;exports.getComponentsArr=V;exports.getRawValue=f;exports.getUrlName=S;exports.isComprops=w;exports.isCurprops=E;exports.setAsideKey=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./storage.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const C=require("@fangzhongya/utils/name/humpToLine"),N=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");const S=require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const x=require("@fangzhongya/utils/judge/matchsStart"),g=require("@fangzhongya/utils/judge/matchsEnd"),R=["vue","js","ts"];function $(t){let e=C.humpToLine(t.name),r=[];return t.alias&&r.push(t.alias+"-"+e),r}function O(t,e,r){const s=x.matchsStart(t,e);return s&&r&&r.length>0?!x.matchsStart(t,r):s}function T(t,e,r){const s=g.matchsEnd(t,e);return s&&r&&r.length>0?!g.matchsEnd(t,r):s}function U(t,e,r){e.lastIndex=0;const s=e.exec(t);if(!s)return!1;const i=s.index;return t.substring(0,i).endsWith(r)}function v(t,e){e.lastIndex=0;const r=e.exec(t);if(!r)return"";const s=r.index;return t.substring(0,s)}function z(t){const e=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`${e(t)}$`)}function d(t,e){if(e&&e.length>0)for(const r of e)if(typeof r=="string"){if(t.endsWith(r)){const s=t.replace(z(r),"");if(s){const i=new RegExp("^.*/([^/]+)$");let n=s.match(i);if(n)return n[1]}}}else{const s=v(t,r);if(s){const i=new RegExp("^.*/([^/]+)$");let n=s.match(i);if(n)return n[1]}}return""}function p(t,e,r){const s=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let i=t.indexOf(s),n=e.dir.substring(0,e.dir.indexOf(s))+t.substring(i),c="";if(e.getNameValue)c=e.getNameValue(t,e);else{const a=e.matchextss;a?c=d(t,[a]):c=d(t,e.matchexts)}if(c){let a={suffix:S.getSuffix(t),name:N.lineToLargeHump(c),value:c,adir:"",alias:e.alias,aliasNames:[],raw:"",getRaw:null,mds:[],tests:void 0,url:n,comprops:e.comprops,curprops:e.curprops,dir:e.dir,cwd:e.cwd,tdir:r,key:t};return a.aliasNames=$(a),a}}function I(t,e,r){for(const s of e){const i="/"+s;if(r&&r.length>0){for(const n of r)if(typeof n=="string"){if(t.endsWith(i+n))return!0}else if(U(t,n,i))return!0}else if(t.includes(s))return!0}return!1}function q(t,e,r,s){const i=[],n=s.matchextss;return n&&i.push(n),t.filter(c=>I(c,[e],i))[0]||""}function w(t,e,r,s,i){if(O(t,e.matchs,e.nomatchs)){let n=!1;if(e.isMatch?n=e.isMatch(t,"",[],e):n=T(t,e.matchexts,e.nomatchexts),n){const c=e.getMatchs,a=d(s,e.matchexts);if(c){const o=c(r,a,"component",e);return p(o,e,i)}else if(e.matchextss){const l=q([s],a,"component",e)||q(r,a,"component",e);if(l)return p(l,e,i)}else return p(s,e,i)}}}function K(t){M.setSession("aside.key",t)}function L(){return M.getSession("aside.key")}function V(t){let e=t.match(/\/([^\/]+)\/$/);return e&&e.length>1?e[1]:""}function E(t,e){if(e)for(let r=0;r<e.length;r++){const s=e[r];if(typeof s=="string"){if(t.includes(s))return!0}else if(s.test(t))return!0}return!1}function b(t,e){if(e)for(let r=0;r<e.length;r++){const s=e[r];if(typeof s=="string"){if(t.endsWith(s))return!0}else if(s.test(t))return!0}return!1}function W(t,e,r,s){const i=[],n=[],c=V(e.dir);return t.forEach(a=>{const o=e.dir.replace(/^\.\/|((\.\.\/)+)/,"/");let l=a.indexOf(o),h=e.dir.substring(0,e.dir.indexOf(o))+a.substring(l);const A=new RegExp("^"+e.dir);let f=h.replace(A,"");if(e.comprops&&E("/"+f,e.comprops)||e.curprops&&b("/"+f,e.curprops)){let u={};u.url=h,u.comprops=e.comprops,u.curprops=e.curprops,u.value=f,u.dir=e.dir,u.cwd=e.cwd,u.suffix=S.getSuffix(a),u.tdir=c,u.key=a,u.raw="",u.getRaw=m(r,a),i.push(u)}else{let u=w(f,e,t,a,c);u&&(u.component=s[u.key],u.getRaw=m(r,u.key),n.push(u))}}),{props:i,components:n}}function m(t,e){return typeof t=="function"?t:t?t[e]:null}exports.defaultExtensions=R;exports.getAsideKey=L;exports.getComponentsArr=W;exports.getRawValue=m;exports.getUrlName=w;exports.isComprops=E;exports.isCurprops=b;exports.setAsideKey=K;
@@ -1,29 +1,36 @@
1
- import { getSession as M, setSession as $ } from "./storage.js";
1
+ import { getSession as E, setSession as S } from "./storage.js";
2
2
  import "@fangzhongya/utils/basic/object/mergeObject";
3
3
  import "@fangzhongya/utils/basic/array/toggleArray";
4
- import { humpToLine as N } from "@fangzhongya/utils/name/humpToLine";
5
- import { lineToLargeHump as R } from "@fangzhongya/utils/name/lineToLargeHump";
4
+ import { humpToLine as $ } from "@fangzhongya/utils/name/humpToLine";
5
+ import { lineToLargeHump as N } from "@fangzhongya/utils/name/lineToLargeHump";
6
6
  import "@fangzhongya/utils/basic/string/appearNum";
7
7
  import "@fangzhongya/utils/basic/string/firstLower";
8
8
  import "@fangzhongya/utils/basic/array/duplicateRemoval";
9
9
  import "@fangzhongya/utils/basic/array/asyncMergeArray";
10
10
  import "@fangzhongya/utils/basic/string/firstUpper";
11
- import { getSuffix as g } from "@fangzhongya/utils/urls/getSuffix";
11
+ import { getSuffix as w } from "@fangzhongya/utils/urls/getSuffix";
12
12
  import "@fangzhongya/utils/basic/array/replaceAfter";
13
- import { matchsStart as m } from "@fangzhongya/utils/judge/matchsStart";
14
- import { matchsEnd as d } from "@fangzhongya/utils/judge/matchsEnd";
15
- const Q = ["vue", "js", "ts"];
16
- function S(t) {
17
- let e = N(t.name), r = [];
13
+ import { matchsStart as h } from "@fangzhongya/utils/judge/matchsStart";
14
+ import { matchsEnd as x } from "@fangzhongya/utils/judge/matchsEnd";
15
+ const Y = ["vue", "js", "ts"];
16
+ function R(t) {
17
+ let e = $(t.name), r = [];
18
18
  return t.alias && r.push(t.alias + "-" + e), r;
19
19
  }
20
- function b(t, e, r) {
21
- const s = m(t, e);
22
- return s && r && r.length > 0 ? !m(t, r) : s;
23
- }
24
20
  function O(t, e, r) {
25
- const s = d(t, e);
26
- return s && r && r.length > 0 ? !d(t, r) : s;
21
+ const s = h(t, e);
22
+ return s && r && r.length > 0 ? !h(t, r) : s;
23
+ }
24
+ function U(t, e, r) {
25
+ const s = x(t, e);
26
+ return s && r && r.length > 0 ? !x(t, r) : s;
27
+ }
28
+ function v(t, e, r) {
29
+ e.lastIndex = 0;
30
+ const s = e.exec(t);
31
+ if (!s) return !1;
32
+ const i = s.index;
33
+ return t.substring(0, i).endsWith(r);
27
34
  }
28
35
  function z(t, e) {
29
36
  e.lastIndex = 0;
@@ -36,44 +43,44 @@ function A(t) {
36
43
  const e = (r) => r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
37
44
  return new RegExp(`${e(t)}$`);
38
45
  }
39
- function h(t, e) {
46
+ function m(t, e) {
40
47
  if (e && e.length > 0)
41
48
  for (const r of e)
42
49
  if (typeof r == "string") {
43
50
  if (t.endsWith(r)) {
44
51
  const s = t.replace(A(r), "");
45
52
  if (s) {
46
- const a = new RegExp("^.*/([^/]+)$");
47
- let u = s.match(a);
48
- if (u)
49
- return u[1];
53
+ const i = new RegExp("^.*/([^/]+)$");
54
+ let n = s.match(i);
55
+ if (n)
56
+ return n[1];
50
57
  }
51
58
  }
52
59
  } else {
53
60
  const s = z(t, r);
54
61
  if (s) {
55
- const a = new RegExp("^.*/([^/]+)$");
56
- let u = s.match(a);
57
- if (u)
58
- return u[1];
62
+ const i = new RegExp("^.*/([^/]+)$");
63
+ let n = s.match(i);
64
+ if (n)
65
+ return n[1];
59
66
  }
60
67
  }
61
68
  return "";
62
69
  }
63
- function f(t, e, r) {
70
+ function p(t, e, r) {
64
71
  const s = e.dir.replace(/^\.\/|((\.\.\/)+)/, "/");
65
- let a = t.indexOf(s), u = e.dir.substring(0, e.dir.indexOf(s)) + t.substring(a), l = "";
72
+ let i = t.indexOf(s), n = e.dir.substring(0, e.dir.indexOf(s)) + t.substring(i), a = "";
66
73
  if (e.getNameValue)
67
- l = e.getNameValue(t, e);
74
+ a = e.getNameValue(t, e);
68
75
  else {
69
- const n = e.matchextss;
70
- n ? l = h(t, [n]) : l = h(t, e.matchexts);
76
+ const o = e.matchextss;
77
+ o ? a = m(t, [o]) : a = m(t, e.matchexts);
71
78
  }
72
- if (l) {
73
- let n = {
74
- suffix: g(t),
75
- name: R(l),
76
- value: l,
79
+ if (a) {
80
+ let o = {
81
+ suffix: w(t),
82
+ name: N(a),
83
+ value: a,
77
84
  adir: "",
78
85
  alias: e.alias,
79
86
  aliasNames: [],
@@ -81,7 +88,7 @@ function f(t, e, r) {
81
88
  getRaw: null,
82
89
  mds: [],
83
90
  tests: void 0,
84
- url: u,
91
+ url: n,
85
92
  comprops: e.comprops,
86
93
  curprops: e.curprops,
87
94
  dir: e.dir,
@@ -89,42 +96,56 @@ function f(t, e, r) {
89
96
  tdir: r,
90
97
  key: t
91
98
  };
92
- return n.aliasNames = S(n), n;
99
+ return o.aliasNames = R(o), o;
93
100
  }
94
101
  }
95
- function C(t, e, r, s, a) {
96
- if (b(t, e.matchs, e.nomatchs)) {
97
- let u = !1;
98
- if (e.isMatch ? u = e.isMatch(t, "", [], e) : u = O(t, e.matchexts, e.nomatchexts), u) {
99
- const l = e.getMatchs;
100
- if (l) {
101
- const n = l(r, "", "", e);
102
- return f(n, e, a);
103
- } else {
104
- const n = e.matchextss;
105
- if (n) {
106
- if (typeof n == "string") {
107
- if (t.endsWith(n))
108
- return f(s, e, a);
109
- } else if (n.test(t))
110
- return f(s, e, a);
111
- } else
112
- return f(s, e, a);
113
- }
102
+ function C(t, e, r) {
103
+ for (const s of e) {
104
+ const i = "/" + s;
105
+ if (r && r.length > 0) {
106
+ for (const n of r)
107
+ if (typeof n == "string") {
108
+ if (t.endsWith(i + n))
109
+ return !0;
110
+ } else if (v(t, n, i))
111
+ return !0;
112
+ } else if (t.includes(s))
113
+ return !0;
114
+ }
115
+ return !1;
116
+ }
117
+ function g(t, e, r, s) {
118
+ const i = [], n = s.matchextss;
119
+ return n && i.push(n), t.filter((a) => C(a, [e], i))[0] || "";
120
+ }
121
+ function I(t, e, r, s, i) {
122
+ if (O(t, e.matchs, e.nomatchs)) {
123
+ let n = !1;
124
+ if (e.isMatch ? n = e.isMatch(t, "", [], e) : n = U(t, e.matchexts, e.nomatchexts), n) {
125
+ const a = e.getMatchs, o = m(s, e.matchexts);
126
+ if (a) {
127
+ const l = a(r, o, "component", e);
128
+ return p(l, e, i);
129
+ } else if (e.matchextss) {
130
+ const f = g([s], o, "component", e) || g(r, o, "component", e);
131
+ if (f)
132
+ return p(f, e, i);
133
+ } else
134
+ return p(s, e, i);
114
135
  }
115
136
  }
116
137
  }
117
- function X(t) {
118
- $("aside.key", t);
138
+ function Z(t) {
139
+ S("aside.key", t);
119
140
  }
120
- function Y() {
121
- return M("aside.key");
141
+ function y() {
142
+ return E("aside.key");
122
143
  }
123
- function D(t) {
144
+ function W(t) {
124
145
  let e = t.match(/\/([^\/]+)\/$/);
125
146
  return e && e.length > 1 ? e[1] : "";
126
147
  }
127
- function T(t, e) {
148
+ function D(t, e) {
128
149
  if (e)
129
150
  for (let r = 0; r < e.length; r++) {
130
151
  const s = e[r];
@@ -136,7 +157,7 @@ function T(t, e) {
136
157
  }
137
158
  return !1;
138
159
  }
139
- function U(t, e) {
160
+ function T(t, e) {
140
161
  if (e)
141
162
  for (let r = 0; r < e.length; r++) {
142
163
  const s = e[r];
@@ -148,35 +169,35 @@ function U(t, e) {
148
169
  }
149
170
  return !1;
150
171
  }
151
- function Z(t, e, r, s) {
152
- const a = [], u = [], l = D(e.dir);
153
- return t.forEach((n) => {
154
- const p = e.dir.replace(/^\.\/|((\.\.\/)+)/, "/");
155
- let w = n.indexOf(p), c = e.dir.substring(0, e.dir.indexOf(p)) + n.substring(w);
156
- const E = new RegExp("^" + e.dir);
157
- let o = c.replace(E, "");
158
- if (e.comprops && T("/" + o, e.comprops) || e.curprops && U("/" + o, e.curprops)) {
159
- let i = {};
160
- i.url = c, i.comprops = e.comprops, i.curprops = e.curprops, i.value = o, i.dir = e.dir, i.cwd = e.cwd, i.suffix = g(n), i.tdir = l, i.key = n, i.raw = "", i.getRaw = x(r, n), a.push(i);
172
+ function k(t, e, r, s) {
173
+ const i = [], n = [], a = W(e.dir);
174
+ return t.forEach((o) => {
175
+ const l = e.dir.replace(/^\.\/|((\.\.\/)+)/, "/");
176
+ let f = o.indexOf(l), d = e.dir.substring(0, e.dir.indexOf(l)) + o.substring(f);
177
+ const b = new RegExp("^" + e.dir);
178
+ let c = d.replace(b, "");
179
+ if (e.comprops && D("/" + c, e.comprops) || e.curprops && T("/" + c, e.curprops)) {
180
+ let u = {};
181
+ u.url = d, u.comprops = e.comprops, u.curprops = e.curprops, u.value = c, u.dir = e.dir, u.cwd = e.cwd, u.suffix = w(o), u.tdir = a, u.key = o, u.raw = "", u.getRaw = M(r, o), i.push(u);
161
182
  } else {
162
- let i = C(o, e, t, n, l);
163
- i && (i.component = s[i.key], i.getRaw = x(r, i.key), u.push(i));
183
+ let u = I(c, e, t, o, a);
184
+ u && (u.component = s[u.key], u.getRaw = M(r, u.key), n.push(u));
164
185
  }
165
186
  }), {
166
- props: a,
167
- components: u
187
+ props: i,
188
+ components: n
168
189
  };
169
190
  }
170
- function x(t, e) {
191
+ function M(t, e) {
171
192
  return typeof t == "function" ? t : t ? t[e] : null;
172
193
  }
173
194
  export {
174
- Q as defaultExtensions,
175
- Y as getAsideKey,
176
- Z as getComponentsArr,
177
- x as getRawValue,
178
- C as getUrlName,
179
- T as isComprops,
180
- U as isCurprops,
181
- X as setAsideKey
195
+ Y as defaultExtensions,
196
+ y as getAsideKey,
197
+ k as getComponentsArr,
198
+ M as getRawValue,
199
+ I as getUrlName,
200
+ D as isComprops,
201
+ T as isCurprops,
202
+ Z as setAsideKey
182
203
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.64",
4
+ "version": "0.0.66",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",
@@ -20,7 +20,7 @@
20
20
  "devDependencies": {
21
21
  "@fangzhongya/create": "0.2.34",
22
22
  "@fangzhongya/utils": "0.0.28",
23
- "@fangzhongya/vue-components": "0.1.16",
23
+ "@fangzhongya/vue-components": "0.1.18",
24
24
  "@highlightjs/vue-plugin": "^2.1.0",
25
25
  "@types/node": "^24.3.0",
26
26
  "@vitejs/plugin-vue": "^6.0.1",