@fangzhongya/vue-archive 0.0.2-34 → 0.0.2-36

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.
@@ -65235,7 +65235,7 @@ function setExpose(obj) {
65235
65235
  }
65236
65236
  function addObj(value, type) {
65237
65237
  const ms = notesObj[type + "name"] || [];
65238
- const name = _nullishCoalesce(value.name, () => ( value.props.name));
65238
+ const name = _nullishCoalesce(value.name, () => ( _optionalChain([value, 'access', _43 => _43[type], 'optionalAccess', _44 => _44.name])));
65239
65239
  const nis = ms.indexOf(name);
65240
65240
  if (nis >= 0) {
65241
65241
  notesObj[type + "s"].splice(nis, 1);
@@ -65252,11 +65252,11 @@ function init2() {
65252
65252
  }
65253
65253
  function getFilter2(obj, arrs) {
65254
65254
  const _objs = {
65255
- descriptions: _optionalChain([obj, 'optionalAccess', _43 => _43.description]) || ""
65255
+ descriptions: _optionalChain([obj, 'optionalAccess', _45 => _45.description]) || ""
65256
65256
  };
65257
65257
  const arr = [];
65258
- if (_optionalChain([obj, 'optionalAccess', _44 => _44.tags])) {
65259
- _optionalChain([obj, 'optionalAccess', _45 => _45.tags, 'optionalAccess', _46 => _46.forEach, 'call', _47 => _47((v) => {
65258
+ if (_optionalChain([obj, 'optionalAccess', _46 => _46.tags])) {
65259
+ _optionalChain([obj, 'optionalAccess', _47 => _47.tags, 'optionalAccess', _48 => _48.forEach, 'call', _49 => _49((v) => {
65260
65260
  let tag = v.tag;
65261
65261
  let ov = getObj2(v);
65262
65262
  if (!_objs.hasOwnProperty(tag)) {
@@ -65323,9 +65323,9 @@ function setTags2(tag, obj) {
65323
65323
  }
65324
65324
  function notesFilter(notes) {
65325
65325
  init2();
65326
- _optionalChain([notes, 'optionalAccess', _48 => _48.forEach, 'call', _49 => _49((obj) => {
65327
- let tags = _optionalChain([obj, 'optionalAccess', _50 => _50.tags]) || [];
65328
- let lg = _optionalChain([tags, 'optionalAccess', _51 => _51.length]) || 0;
65326
+ _optionalChain([notes, 'optionalAccess', _50 => _50.forEach, 'call', _51 => _51((obj) => {
65327
+ let tags = _optionalChain([obj, 'optionalAccess', _52 => _52.tags]) || [];
65328
+ let lg = _optionalChain([tags, 'optionalAccess', _53 => _53.length]) || 0;
65329
65329
  if (lg > 0) {
65330
65330
  for (let i = 0; i < lg; i++) {
65331
65331
  const v = tags[i] || {};
@@ -65467,7 +65467,7 @@ function getTopDom(props2, h4) {
65467
65467
  doms = [];
65468
65468
  }
65469
65469
  };
65470
- _optionalChain([props2, 'optionalAccess', _52 => _52.forEach, 'call', _53 => _53((obj) => {
65470
+ _optionalChain([props2, 'optionalAccess', _54 => _54.forEach, 'call', _55 => _55((obj) => {
65471
65471
  const info = [];
65472
65472
  let is = false;
65473
65473
  if (obj.date) {
@@ -65892,25 +65892,25 @@ function writeFileUrl(url, files, callback, isDirs, isFile) {
65892
65892
 
65893
65893
  function styleLog(msg = "", obj) {
65894
65894
  const arr = ["\x1B[0m"];
65895
- if (_optionalChain([obj, 'optionalAccess', _54 => _54.revert])) {
65895
+ if (_optionalChain([obj, 'optionalAccess', _56 => _56.revert])) {
65896
65896
  arr.push("\x1B[4m");
65897
65897
  }
65898
- if (_optionalChain([obj, 'optionalAccess', _55 => _55.lineThrough])) {
65898
+ if (_optionalChain([obj, 'optionalAccess', _57 => _57.lineThrough])) {
65899
65899
  arr.push("\x1B[9m");
65900
65900
  }
65901
- if (_optionalChain([obj, 'optionalAccess', _56 => _56.italic])) {
65901
+ if (_optionalChain([obj, 'optionalAccess', _58 => _58.italic])) {
65902
65902
  arr.push("\x1B[3m");
65903
65903
  }
65904
- if (_optionalChain([obj, 'optionalAccess', _57 => _57.bold])) {
65904
+ if (_optionalChain([obj, 'optionalAccess', _59 => _59.bold])) {
65905
65905
  arr.push("\x1B[1m");
65906
65906
  }
65907
- if (_optionalChain([obj, 'optionalAccess', _58 => _58.bag])) {
65908
- arr.push(`\x1B[4${_optionalChain([obj, 'optionalAccess', _59 => _59.bag])}m`);
65907
+ if (_optionalChain([obj, 'optionalAccess', _60 => _60.bag])) {
65908
+ arr.push(`\x1B[4${_optionalChain([obj, 'optionalAccess', _61 => _61.bag])}m`);
65909
65909
  } else {
65910
65910
  arr.push("\x1B[40m");
65911
65911
  }
65912
- if (_optionalChain([obj, 'optionalAccess', _60 => _60.text])) {
65913
- arr.push(`\x1B[3${_optionalChain([obj, 'optionalAccess', _61 => _61.text])}m`);
65912
+ if (_optionalChain([obj, 'optionalAccess', _62 => _62.text])) {
65913
+ arr.push(`\x1B[3${_optionalChain([obj, 'optionalAccess', _63 => _63.text])}m`);
65914
65914
  } else {
65915
65915
  arr.push("\x1B[30m");
65916
65916
  }
@@ -66357,15 +66357,12 @@ function nodeInit(c, callback) {
66357
66357
  if (typeof c.setHtml === "function") {
66358
66358
  setHtml = c.setHtml;
66359
66359
  }
66360
- Fang = runDev(_optionalChain([c, 'optionalAccess', _62 => _62.create]));
66360
+ Fang = runDev(_optionalChain([c, 'optionalAccess', _64 => _64.create]));
66361
66361
  getCompoNameObj().forEach((v) => {
66362
66362
  mls.push(v);
66363
66363
  getCompoData(v);
66364
66364
  });
66365
66365
  }
66366
- function getCompoData(obj) {
66367
- getData(obj);
66368
- }
66369
66366
  function gettests(obj, arr) {
66370
66367
  const tests = getTestName(obj.key);
66371
66368
  asyncMergeArray(tests, (res, _reject, zv, inde) => {
@@ -66422,7 +66419,7 @@ function setDom(dom) {
66422
66419
  arr.push(prettierHtml(dom));
66423
66420
  return arr;
66424
66421
  }
66425
- function getData(value) {
66422
+ function getCompoData(value) {
66426
66423
  const arr = [];
66427
66424
  arr.push("# " + value.name);
66428
66425
  getNotes2(value.key).then((obj) => {
@@ -66438,7 +66435,7 @@ function getData(value) {
66438
66435
  const list = [
66439
66436
  ...getlistDom(propss, "\u7EC4\u4EF6\u5C5E\u6027", tprops),
66440
66437
  ...getlistDom(emitss, "\u7EC4\u4EF6\u4E8B\u4EF6", temits),
66441
- ...getlistDom(emitss, "\u7EC4\u4EF6\u65B9\u6CD5", texpose),
66438
+ ...getlistDom(exposes, "\u7EC4\u4EF6\u65B9\u6CD5", texpose),
66442
66439
  ...getlistDom(slots, "\u7EC4\u4EF6\u63D2\u69FD", tslot)
66443
66440
  ];
66444
66441
  arr.push(...list);
@@ -66472,7 +66469,7 @@ function getlistDom(arr, t, list) {
66472
66469
  const arrs = [];
66473
66470
  const ths = [];
66474
66471
  list.forEach((item) => {
66475
- let v = _optionalChain([item, 'optionalAccess', _63 => _63.label]) || "";
66472
+ let v = _optionalChain([item, 'optionalAccess', _65 => _65.label]) || "";
66476
66473
  v = v.replace(/</g, "&lt;").replace(/>/g, "&gt;");
66477
66474
  ths.push(setHtml("th", {}, [v]));
66478
66475
  });
@@ -65235,7 +65235,7 @@ function setExpose(obj) {
65235
65235
  }
65236
65236
  function addObj(value, type) {
65237
65237
  const ms = notesObj[type + "name"] || [];
65238
- const name = value.name ?? value.props.name;
65238
+ const name = value.name ?? value[type]?.name;
65239
65239
  const nis = ms.indexOf(name);
65240
65240
  if (nis >= 0) {
65241
65241
  notesObj[type + "s"].splice(nis, 1);
@@ -66363,9 +66363,6 @@ function nodeInit(c, callback) {
66363
66363
  getCompoData(v);
66364
66364
  });
66365
66365
  }
66366
- function getCompoData(obj) {
66367
- getData(obj);
66368
- }
66369
66366
  function gettests(obj, arr) {
66370
66367
  const tests = getTestName(obj.key);
66371
66368
  asyncMergeArray(tests, (res, _reject, zv, inde) => {
@@ -66422,7 +66419,7 @@ function setDom(dom) {
66422
66419
  arr.push(prettierHtml(dom));
66423
66420
  return arr;
66424
66421
  }
66425
- function getData(value) {
66422
+ function getCompoData(value) {
66426
66423
  const arr = [];
66427
66424
  arr.push("# " + value.name);
66428
66425
  getNotes2(value.key).then((obj) => {
@@ -66438,7 +66435,7 @@ function getData(value) {
66438
66435
  const list = [
66439
66436
  ...getlistDom(propss, "\u7EC4\u4EF6\u5C5E\u6027", tprops),
66440
66437
  ...getlistDom(emitss, "\u7EC4\u4EF6\u4E8B\u4EF6", temits),
66441
- ...getlistDom(emitss, "\u7EC4\u4EF6\u65B9\u6CD5", texpose),
66438
+ ...getlistDom(exposes, "\u7EC4\u4EF6\u65B9\u6CD5", texpose),
66442
66439
  ...getlistDom(slots, "\u7EC4\u4EF6\u63D2\u69FD", tslot)
66443
66440
  ];
66444
66441
  arr.push(...list);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../utils/index.cjs"),b=require("../../utils/glob.cjs"),a=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function x(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]],o=l.map(i=>i[0]).indexOf(r);if(o!=-1){let n=new RegExp("^"+l[o][0]+"((.|\\n|\\r)+?)"+l[o][1]+(s?"\\s":""),"gi").exec(e);if(n)return n[0]}}function y(e){delete e.problems,delete e.source;let s=e.tag,r=e.name,l=e.description,t=e.default,o="";if(s=="default")r=r.trim(),r=x(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const u=r.split("=");r=u[0];const h=u[1]+" "+l,d=x(h,!0);d?(t=d,l=h.replace(d,"")):t=e.default||u[1]||""}const n=/\s*\((.*)\)\s/gi.exec(l);n&&n.length>0&&(o=n[1],l=l.replace(n[0],""))}return e.name=r,e.default=t||"",e.description=l,e.selectable=o,e}function O(e){let s=["title","text","author","date"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),g(l),r.arr.forEach(t=>{m(t.key,t.value)})}function g(e){c.titles.push(e)}function T(e){let s=["props","name","type","default","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"props"),r.arr.forEach(t=>{m(t.key,t.value)})}function w(e){let s=["slot","name","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"slot"),r.arr.forEach(t=>{m(t.key,t.value)})}function P(e){let s=["emits","name","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"emits"),r.arr.forEach(t=>{m(t.key,t.value)})}function k(e){let s=["expose","name","type","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"expose"),r.arr.forEach(t=>{m(t.key,t.value)})}function p(e,s){const r=c[s+"name"]||[],l=e.name??e.props.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 q(){Object.keys(c).forEach(e=>{c[e]=[]})}function f(e,s){var t;const r={descriptions:(e==null?void 0:e.description)||""},l=[];return e!=null&&e.tags&&((t=e==null?void 0:e.tags)==null||t.forEach(o=>{let i=o.tag,n=y(o);if(!r.hasOwnProperty(i))r[i]=n;else{const u={};u[i]=n,l.push({key:i,value:u})}})),{arr:l,obj:r}}function m(e,s){switch(e){case"title":return g(s),!0;case"text":return g(s),!0;case"props":return p(s,"props"),!0;case"slot":return p(s,"slot"),!0;case"emits":return p(s,"emits"),!0;case"expose":return p(s,"expose"),!0;default:return!1}}function M(e,s){switch(e){case"title":return O(s),!0;case"props":return T(s),!0;case"slot":return w(s),!0;case"emits":return P(s),!0;case"expose":return k(s),!0;default:return!1}}function N(e){return q(),e==null||e.forEach(s=>{let r=(s==null?void 0:s.tags)||[],l=(r==null?void 0:r.length)||0;if(l>0)for(let t=0;t<l;t++){const o=r[t]||{};if(M(o.tag,s))break}}),c}function S(e){return new Promise(s=>{b.getLocalTextComponents(e).then(r=>{let l=E.getTextNotes(r);s(N(l))})})}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}],K=[{label:"事件名",prop:"name",formatter:a.emits.name},{label:"说明",prop:"description",formatter:a.emits.description},{label:"回调参数",prop:"selectable",formatter:a.emits.selectable}],v=[{label:"方法名",prop:"name",formatter:a.expose.name},{label:"说明",prop:"description",formatter:a.expose.description},{label:"参数",prop:"selectable",formatter:a.expose.selectable},{label:"返回值",prop:"type",formatter:a.expose.type}],z=[{label:"插槽名",prop:"name",formatter:a.slot.name},{label:"说明",prop:"description",formatter:a.slot.description},{label:"作用域参数",prop:"selectable",formatter:a.slot.selectable}];exports.getKeyMds=b.getKeyMds;exports.getNotes=S;exports.temits=K;exports.texpose=v;exports.tprops=F;exports.tslot=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../utils/index.cjs"),b=require("../../utils/glob.cjs"),a=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function x(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]],o=l.map(i=>i[0]).indexOf(r);if(o!=-1){let n=new RegExp("^"+l[o][0]+"((.|\\n|\\r)+?)"+l[o][1]+(s?"\\s":""),"gi").exec(e);if(n)return n[0]}}function y(e){delete e.problems,delete e.source;let s=e.tag,r=e.name,l=e.description,t=e.default,o="";if(s=="default")r=r.trim(),r=x(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const u=r.split("=");r=u[0];const h=u[1]+" "+l,d=x(h,!0);d?(t=d,l=h.replace(d,"")):t=e.default||u[1]||""}const n=/\s*\((.*)\)\s/gi.exec(l);n&&n.length>0&&(o=n[1],l=l.replace(n[0],""))}return e.name=r,e.default=t||"",e.description=l,e.selectable=o,e}function O(e){let s=["title","text","author","date"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),g(l),r.arr.forEach(t=>{m(t.key,t.value)})}function g(e){c.titles.push(e)}function T(e){let s=["props","name","type","default","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"props"),r.arr.forEach(t=>{m(t.key,t.value)})}function w(e){let s=["slot","name","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"slot"),r.arr.forEach(t=>{m(t.key,t.value)})}function P(e){let s=["emits","name","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"emits"),r.arr.forEach(t=>{m(t.key,t.value)})}function k(e){let s=["expose","name","type","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"expose"),r.arr.forEach(t=>{m(t.key,t.value)})}function p(e,s){var o;const r=c[s+"name"]||[],l=e.name??((o=e[s])==null?void 0:o.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 q(){Object.keys(c).forEach(e=>{c[e]=[]})}function f(e,s){var t;const r={descriptions:(e==null?void 0:e.description)||""},l=[];return e!=null&&e.tags&&((t=e==null?void 0:e.tags)==null||t.forEach(o=>{let i=o.tag,n=y(o);if(!r.hasOwnProperty(i))r[i]=n;else{const u={};u[i]=n,l.push({key:i,value:u})}})),{arr:l,obj:r}}function m(e,s){switch(e){case"title":return g(s),!0;case"text":return g(s),!0;case"props":return p(s,"props"),!0;case"slot":return p(s,"slot"),!0;case"emits":return p(s,"emits"),!0;case"expose":return p(s,"expose"),!0;default:return!1}}function M(e,s){switch(e){case"title":return O(s),!0;case"props":return T(s),!0;case"slot":return w(s),!0;case"emits":return P(s),!0;case"expose":return k(s),!0;default:return!1}}function N(e){return q(),e==null||e.forEach(s=>{let r=(s==null?void 0:s.tags)||[],l=(r==null?void 0:r.length)||0;if(l>0)for(let t=0;t<l;t++){const o=r[t]||{};if(M(o.tag,s))break}}),c}function S(e){return new Promise(s=>{b.getLocalTextComponents(e).then(r=>{let l=E.getTextNotes(r);s(N(l))})})}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}],K=[{label:"事件名",prop:"name",formatter:a.emits.name},{label:"说明",prop:"description",formatter:a.emits.description},{label:"回调参数",prop:"selectable",formatter:a.emits.selectable}],v=[{label:"方法名",prop:"name",formatter:a.expose.name},{label:"说明",prop:"description",formatter:a.expose.description},{label:"参数",prop:"selectable",formatter:a.expose.selectable},{label:"返回值",prop:"type",formatter:a.expose.type}],z=[{label:"插槽名",prop:"name",formatter:a.slot.name},{label:"说明",prop:"description",formatter:a.slot.description},{label:"作用域参数",prop:"selectable",formatter:a.slot.selectable}];exports.getKeyMds=b.getKeyMds;exports.getNotes=S;exports.temits=K;exports.texpose=v;exports.tprops=F;exports.tslot=z;
@@ -1,4 +1,4 @@
1
- import { getTextNotes as O } from "../../utils/index.js";
1
+ import { getTextNotes as y } from "../../utils/index.js";
2
2
  import { getLocalTextComponents as T } from "../../utils/glob.js";
3
3
  import { getKeyMds as H } from "../../utils/glob.js";
4
4
  import { props as f, emits as h, expose as d, slot as x } from "../../utils/props.js";
@@ -9,7 +9,7 @@ const c = {
9
9
  emitss: [],
10
10
  exposes: []
11
11
  };
12
- function y(e, s) {
12
+ function O(e, s) {
13
13
  let r = e.charAt(0), l = [
14
14
  ['"', '"'],
15
15
  ["'", "'"],
@@ -31,14 +31,14 @@ function w(e) {
31
31
  delete e.problems, delete e.source;
32
32
  let s = e.tag, r = e.name, l = e.description, t = e.default, a = "";
33
33
  if (s == "default")
34
- r = r.trim(), r = y(r) || r;
34
+ r = r.trim(), r = O(r) || r;
35
35
  else if (s == "selectable")
36
36
  r = r.trim();
37
37
  else {
38
38
  if (r.includes("=")) {
39
39
  const p = r.split("=");
40
40
  r = p[0];
41
- const E = p[1] + " " + l, g = y(E, !0);
41
+ const E = p[1] + " " + l, g = O(E, !0);
42
42
  g ? (t = g, l = E.replace(g, "")) : t = e.default || p[1] || "";
43
43
  }
44
44
  const o = /\s*\((.*)\)\s/gi.exec(l);
@@ -125,7 +125,8 @@ function z(e) {
125
125
  });
126
126
  }
127
127
  function i(e, s) {
128
- const r = c[s + "name"] || [], l = e.name ?? e.props.name, t = r.indexOf(l);
128
+ var a;
129
+ const r = c[s + "name"] || [], l = e.name ?? ((a = e[s]) == null ? void 0 : a.name), t = r.indexOf(l);
129
130
  t >= 0 && (c[s + "s"].splice(t, 1), r.splice(t, 1)), c[s + "s"].push(e), r.push(l), c[s + "name"] = r;
130
131
  }
131
132
  function A() {
@@ -202,7 +203,7 @@ function D(e) {
202
203
  function R(e) {
203
204
  return new Promise((s) => {
204
205
  T(e).then((r) => {
205
- let l = O(r);
206
+ let l = y(r);
206
207
  s(D(l));
207
208
  });
208
209
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.2-34",
4
+ "version": "0.0.2-36",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",