@fangzhongya/vue-archive 0.0.69 → 0.0.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/index.css +2 -2
- package/dist/node/index.cjs +101593 -1279
- package/dist/node/index.d.cts +2 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.js +101580 -1270
- package/dist/packages/components/use/code.cjs +15 -16
- package/dist/packages/components/use/code.d.ts +2 -2
- package/dist/packages/components/use/code.js +76 -74
- package/dist/packages/components/use/edit.cjs +11 -11
- package/dist/packages/components/use/edit.d.ts +1 -1
- package/dist/packages/components/use/edit.js +119 -94
- package/dist/packages/components/use/prettier.cjs +1 -0
- package/dist/packages/components/use/prettier.d.ts +1 -4
- package/dist/packages/components/use/prettier.js +40 -0
- package/dist/packages/components/use/retrie/array/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/array/index.vue.js +17 -16
- package/dist/packages/components/use/retrie/function/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/function/index.vue.js +22 -20
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.cjs +3 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.js +58 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.cjs +1 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.js +62 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.cjs +1 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.js +5 -0
- package/dist/packages/components/use/retrie/input/editor/editor.cjs +3 -0
- package/dist/packages/components/use/retrie/input/{codemirror.d.ts → editor/editor.d.ts} +9 -9
- package/dist/packages/components/use/retrie/input/editor/editor.js +39 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue.cjs +1 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue.js +53 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue3.cjs +1 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue3.js +5 -0
- package/dist/packages/components/use/retrie/input/editor/init.cjs +1 -0
- package/dist/packages/components/use/retrie/input/editor/init.d.ts +1 -0
- package/dist/packages/components/use/retrie/input/editor/init.js +16 -0
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.js +25 -15
- package/dist/packages/components/use/retrie/input/text.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/text.vue.js +21 -13
- package/dist/packages/components/use/retrie/number/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/number/index.vue.js +24 -22
- package/dist/packages/components/use/retrie/object/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/object/index.vue.js +15 -14
- package/dist/packages/components/use/retrie/other/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/other/index.vue.js +17 -16
- package/dist/packages/components/use/retrie/slot/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/slot/index.vue.js +19 -17
- package/dist/packages/components/use/retrie/string/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/string/index.vue.js +20 -18
- package/dist/packages/components/use/set-code.vue.cjs +1 -1
- package/dist/packages/components/use/set-code.vue.js +7 -7
- package/dist/packages/components/use/util.cjs +3 -3
- package/dist/packages/components/use/util.d.ts +10 -5
- package/dist/packages/components/use/util.js +88 -62
- package/dist/packages/config.d.ts +3 -1
- package/dist/packages/page/edit/index.vue2.cjs +1 -1
- package/dist/packages/page/edit/index.vue2.js +11 -7
- package/package.json +7 -6
- package/dist/packages/components/use/codemirror.cjs +0 -3
- package/dist/packages/components/use/codemirror.js +0 -31
- package/dist/packages/components/use/retrie/input/codemirror.vue.cjs +0 -1
- package/dist/packages/components/use/retrie/input/codemirror.vue.js +0 -43
- package/dist/packages/components/use/retrie/input/codemirror.vue2.cjs +0 -1
- package/dist/packages/components/use/retrie/input/codemirror.vue2.js +0 -4
- /package/dist/packages/components/use/{codemirror.d.ts → retrie/input/codemirror/codemirror.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as c, ref as
|
|
2
|
-
import { getString as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as c, ref as m, watch as p, createElementBlock as d, openBlock as f, withDirectives as v, createElementVNode as g, withModifiers as x, vModelText as _ } from "vue";
|
|
2
|
+
import { getString as V } from "../../util.js";
|
|
3
|
+
const h = { class: "form-string" }, B = /* @__PURE__ */ c({
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
|
6
6
|
modelValue: {
|
|
@@ -17,32 +17,34 @@ const g = { class: "form-string" }, h = ["value"], B = /* @__PURE__ */ c({
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
emits: ["value"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
() =>
|
|
20
|
+
setup(i, { emit: a }) {
|
|
21
|
+
const l = i, r = a, t = m("");
|
|
22
|
+
p(
|
|
23
|
+
() => l.modelValue,
|
|
24
24
|
() => {
|
|
25
|
-
let e =
|
|
26
|
-
|
|
25
|
+
let e = l.modelValue;
|
|
26
|
+
t.value = n(e);
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
immediate: !0
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
function u(e) {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const o = t.value;
|
|
34
|
+
n(o);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return e ? (e =
|
|
36
|
+
function n(e) {
|
|
37
|
+
return e ? (e = V(e), r("value", e, JSON.stringify(e)), e) : (r("value", void 0, JSON.stringify("")), "");
|
|
38
38
|
}
|
|
39
|
-
return (e,
|
|
40
|
-
|
|
39
|
+
return (e, o) => (f(), d("div", h, [
|
|
40
|
+
v(g("textarea", {
|
|
41
41
|
class: "form-string-text",
|
|
42
42
|
rows: "3",
|
|
43
|
-
|
|
44
|
-
onBlur:
|
|
45
|
-
}, null,
|
|
43
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
|
|
44
|
+
onBlur: x(u, ["stop"])
|
|
45
|
+
}, null, 544), [
|
|
46
|
+
[_, t.value]
|
|
47
|
+
])
|
|
46
48
|
]));
|
|
47
49
|
}
|
|
48
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),
|
|
1
|
+
"use strict";const t=require("vue"),c=require("./code.vue.cjs"),n=require("./code.cjs"),p={class:"set-code"},r=t.defineComponent({__name:"set-code",props:{name:{type:String},param:{type:Object},value:{type:Object},slotValue:{type:Object},propsText:{type:Object},exposeText:{type:Object}},setup(a){const e=a,s=t.ref("");t.watch([()=>e.name,()=>e.param,()=>e.value,()=>e.slotValue,()=>e.propsText,()=>e.exposeText],()=>{o()},{deep:!0});async function o(){s.value=await n.getHmtl(e.name||"",e.param||{},e.value||{},e.slotValue,e.propsText,e.exposeText)}return(l,u)=>(t.openBlock(),t.createElementBlock("div",p,[t.createVNode(c,{name:e.name,html:s.value,onRefresh:o},null,8,["name","html"])]))}});module.exports=r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as p, ref as n, watch as
|
|
1
|
+
import { defineComponent as p, ref as n, watch as s, createElementBlock as r, openBlock as c, createVNode as m } from "vue";
|
|
2
2
|
import l from "./code.vue.js";
|
|
3
3
|
import { getHmtl as u } from "./code.js";
|
|
4
|
-
const
|
|
4
|
+
const i = { class: "set-code" }, y = /* @__PURE__ */ p({
|
|
5
5
|
__name: "set-code",
|
|
6
6
|
props: {
|
|
7
7
|
name: {
|
|
@@ -25,7 +25,7 @@ const f = { class: "set-code" }, v = /* @__PURE__ */ p({
|
|
|
25
25
|
},
|
|
26
26
|
setup(a) {
|
|
27
27
|
const e = a, t = n("");
|
|
28
|
-
|
|
28
|
+
s(
|
|
29
29
|
[
|
|
30
30
|
() => e.name,
|
|
31
31
|
() => e.param,
|
|
@@ -39,8 +39,8 @@ const f = { class: "set-code" }, v = /* @__PURE__ */ p({
|
|
|
39
39
|
},
|
|
40
40
|
{ deep: !0 }
|
|
41
41
|
);
|
|
42
|
-
function o() {
|
|
43
|
-
t.value = u(
|
|
42
|
+
async function o() {
|
|
43
|
+
t.value = await u(
|
|
44
44
|
e.name || "",
|
|
45
45
|
e.param || {},
|
|
46
46
|
e.value || {},
|
|
@@ -49,7 +49,7 @@ const f = { class: "set-code" }, v = /* @__PURE__ */ p({
|
|
|
49
49
|
e.exposeText
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
return (
|
|
52
|
+
return (f, x) => (c(), r("div", i, [
|
|
53
53
|
m(l, {
|
|
54
54
|
name: e.name,
|
|
55
55
|
html: t.value,
|
|
@@ -59,5 +59,5 @@ const f = { class: "set-code" }, v = /* @__PURE__ */ p({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
y as default
|
|
63
63
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("@fangzhongya/utils/basic/string/toFunction"),
|
|
2
|
-
`)}function
|
|
3
|
-
|\r)+?)\\}[\\s|\\n|\\r]*`,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../../config.cjs"),A=require("@fangzhongya/utils/basic/string/toFunction"),x=require("@fangzhongya/utils/basic/string/firstLower");let c=e=>e;const f=O.getConfig("prettier");f&&Promise.resolve().then(()=>require("./prettier.cjs")).then(e=>{c=e.getFormat});function g(e){return f?c(e,"js"):e.replace(/\;(\s|\n\r)*$/,"")}async function q(e){return e="let a = "+e,(await g(e)).replace(/^let a = /,"")}function W(e){return g(e)}async function k(e){return!/^\s*function/.test(e)&&!/^\s*\([^\)]*\)\s*\=\>/.test(e)?(e="function a"+e,(await g(e)).replace(/^function a/,"")):await g(e)}function C(e){return f?c(e,"html"):e}function E(e){return f?c(e,"ts"):e}function B(e){return f?c(e,"js"):e}function L(e){return f?c(e,"css"):e}function P(e,r=""){let t=(e+"").trim().split(/\n/);return t=t.map(n=>r+n),t.join(`
|
|
2
|
+
`)}function F(e=""){e=e.trim();let r=`[\\s|\\n|\\r]*\\{((.|
|
|
3
|
+
|\r)+?)\\}[\\s|\\n|\\r]*`,n=new RegExp("^"+r+"$").exec(e);return n&&n.length>0?F(n[1]):e}const H=["Boolean","Any","String","Number","Array","Object","Function"];function J(e){return H.includes(e)?x.firstLower(e):e}function M(e){let t=new RegExp("^([a-z|A-Z]+)\\<(.+)\\>$").exec(e);if(t&&t.length>0)return{own:J(t[1]),son:t[2]}}function j(e,r){let t=M(e);t?(r.push(t.own),t.son&&j(t.son,r)):r.push(e)}function b(e){e instanceof Array&&(e=e[0]);const r=[];return e&&j(e,r),r}function v(e){const r=Object.prototype.toString.call(e);let n=/^\[[O|o]bject (.*)\]$/.exec(r),i=typeof e;return n&&n.length>0&&(i=n[1].toLowerCase()),i}function N(e,r){const t=v(e),n=b(r)[0];return n&&n!="any"?t==n:!0}function R(e){if(typeof e=="string"){let r=!1;return(/^\'(.|\n|\r)*\'$/.test(e)||/^\"(.|\n|\r)*\"$/.test(e)||/^\`(.|\n|\r)*\`$/.test(e))&&(r=!0),r&&(e=e.substring(1,e.length-1)),e+""}else return typeof e=="object"&&e?e.toString():typeof e>"u"||typeof e=="object"&&!e?"":e+""}function V(e){const r=typeof e;if(r=="string"){e=(e+"").replace(/^(\s|\n|r)*/,"").replace(/(\s|\n|r)*$/,"");let t="";return/^\'(.|\n|\r)*\'$/.test(e)||/^\"(.|\n|\r)*\"$/.test(e)||/^\`(.|\n|\r)*\`$/.test(e)?t="string":/^\[(.|\n|\r)*\]$/.test(e)?t="array":/^\{(.|\n|\r)*\}$/.test(e)?t="object":/^[0-9]*$/.test(e)?t="number":e==="true"||e==="false"?t="boolean":e=="undefined"?t="undefined":e=="null"?t="null":e&&(t="string"),t}else return r==="object"?e instanceof Array?"array":r===null?"null":r:r}function $(e){const r=e[0]||"any";let t=r.split("<")[0];switch(t=t.trim().toLowerCase(),t){case"string":return'""';case"boolean":return"false";case"number":return"0";case"array":let n=r.indexOf("<"),i=r.substring(r.indexOf("<")+1,r.length-1)||"";n==-1&&(i="any");let o=$(d(i).dataType);return o=o=="undefined"?"":o,`[${o}]`;case"object":return"{}";case"function":return"()=>{}";case"any":return'""';default:return"undefined"}}function z(e){let r="";return e.forEach((t,n)=>{t=t.trim(),t&&(r&&(r+=" | "),t==="Array"?r+="Array<any>":r+=t)}),r||"any"}const y=(e,r)=>{let t=[],n=[],i="";for(let o=0;o<e.length;o++){const s=e[o];s==="["||s==="<"||s==="("?(t.push(s),i+=s):s==="]"&&t.length>0&&t[t.length-1]==="["||s===">"&&t.length>0&&t[t.length-1]==="<"||s===")"&&t.length>0&&t[t.length-1]==="("?(t.pop(),i+=s):s===r&&t.length===0?(n.push(i.trim()),i=""):i+=s}return i.trim()!==""&&n.push(i.trim()),n},d=e=>{if(e)if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("(")&&e.endsWith(")")){const r=e.slice(1,-1).trim();if(!r)return{type:"any",dataType:["any"]};const t=y(r,",");return{type:t[0]||"any",dataType:t}}else if(e.startsWith("<")&&e.endsWith(">")){const r=e.slice(1,-1).trim();if(!r)return{type:"any",dataType:["any"]};const t=y(r,"|");return{type:t[0]||"any",dataType:t}}else{const r=y(e,",");return{type:r[0]||"any",dataType:r}}else return{type:"any",dataType:["any"]}};function I(e){return y(e,",").map(t=>{const n=t.trim(),i=t.match(/^([^:?]+)(\??):/);if(!i)return null;const o=i[1].trim(),s=!i[2],S=i[0].length,p=t.substring(S).trim();let a=[],h="",m="";for(let l=0;l<p.length;l++){const u=p[l];if(u==="["||u==="<"||u==="("?a.push(u):(u==="]"&&a[a.length-1]==="["||u===">"&&a[a.length-1]==="<"||u===")"&&a[a.length-1]==="(")&&a.pop(),a.length===0&&l>0){l==1&&u!=="]"&&u!==">"&&u!==")"?(h="",m=p.substring(0)):(h=p.substring(0,l+1).trim(),m=p.substring(l+1));break}}const{type:Z,dataType:T}=d(h),w=b(T);return{name:o,prop:o,type:w[0],dataType:T,must:s,label:n,description:m}}).filter(Boolean)}Object.defineProperty(exports,"getFunctionFormat",{enumerable:!0,get:()=>A.getFunctionFormat});exports.getFunBody=F;exports.getObjType=v;exports.getSonType=b;exports.getString=R;exports.getTypeValue=$;exports.isDefaultType=V;exports.isTypeEqual=N;exports.parseParamString=I;exports.parseTypeDefinition=d;exports.prettierArrFormat=W;exports.prettierCss=L;exports.prettierFormat=g;exports.prettierFunFormat=k;exports.prettierHtml=C;exports.prettierJs=B;exports.prettierObjFormat=q;exports.prettierTs=E;exports.setDataType=z;exports.vueFormat=P;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export declare function prettierFormat(st: string):
|
|
2
|
-
export declare function prettierObjFormat(st: string):
|
|
3
|
-
export declare function prettierArrFormat(st: string):
|
|
4
|
-
export declare function prettierFunFormat(st: string):
|
|
5
|
-
export declare function prettierHtml(st: string):
|
|
1
|
+
export declare function prettierFormat(st: string): any;
|
|
2
|
+
export declare function prettierObjFormat(st: string): Promise<any>;
|
|
3
|
+
export declare function prettierArrFormat(st: string): any;
|
|
4
|
+
export declare function prettierFunFormat(st: string): Promise<any>;
|
|
5
|
+
export declare function prettierHtml(st: string): any;
|
|
6
|
+
export declare function prettierJson(st: string): any;
|
|
7
|
+
export declare function prettierTs(st: string): any;
|
|
8
|
+
export declare function prettierJs(st: string): any;
|
|
9
|
+
export declare function prettierCss(st: string): any;
|
|
10
|
+
export declare function prettierVue(st: string): any;
|
|
6
11
|
export declare function vueFormat(st: string, kg?: string): string;
|
|
7
12
|
export declare function getFunBody(sr?: string): string;
|
|
8
13
|
export { getFunctionFormat } from '@fangzhongya/utils/basic/string/toFunction';
|
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { getConfig as F } from "../../config.js";
|
|
2
|
+
import { getFunctionFormat as X } from "@fangzhongya/utils/basic/string/toFunction";
|
|
3
|
+
import { firstLower as w } from "@fangzhongya/utils/basic/string/firstLower";
|
|
4
|
+
let c = (e) => e;
|
|
5
|
+
const f = F("prettier");
|
|
6
|
+
f && import("./prettier.js").then((e) => {
|
|
7
|
+
c = e.getFormat;
|
|
8
|
+
});
|
|
9
|
+
function y(e) {
|
|
10
|
+
return f ? c(e, "js") : e.replace(/\;(\s|\n\r)*$/, "");
|
|
11
|
+
}
|
|
12
|
+
async function L(e) {
|
|
13
|
+
return e = "let a = " + e, (await y(e)).replace(/^let a = /, "");
|
|
5
14
|
}
|
|
6
|
-
function
|
|
7
|
-
return
|
|
15
|
+
function N(e) {
|
|
16
|
+
return y(e);
|
|
17
|
+
}
|
|
18
|
+
async function R(e) {
|
|
19
|
+
return !/^\s*function/.test(e) && !/^\s*\([^\)]*\)\s*\=\>/.test(e) ? (e = "function a" + e, (await y(e)).replace(/^function a/, "")) : await y(e);
|
|
20
|
+
}
|
|
21
|
+
function q(e) {
|
|
22
|
+
return f ? c(e, "html") : e;
|
|
23
|
+
}
|
|
24
|
+
function z(e) {
|
|
25
|
+
return f ? c(e, "ts") : e;
|
|
26
|
+
}
|
|
27
|
+
function H(e) {
|
|
28
|
+
return f ? c(e, "js") : e;
|
|
8
29
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
30
|
+
function I(e) {
|
|
31
|
+
return f ? c(e, "css") : e;
|
|
11
32
|
}
|
|
12
|
-
function
|
|
33
|
+
function J(e, n = "") {
|
|
13
34
|
let t = (e + "").trim().split(/\n/);
|
|
14
35
|
return t = t.map((r) => n + r), t.join(`
|
|
15
36
|
`);
|
|
@@ -29,42 +50,42 @@ const S = [
|
|
|
29
50
|
"Object",
|
|
30
51
|
"Function"
|
|
31
52
|
];
|
|
32
|
-
function w(e) {
|
|
33
|
-
return S.includes(e) ? j(e) : e;
|
|
34
|
-
}
|
|
35
53
|
function A(e) {
|
|
54
|
+
return S.includes(e) ? w(e) : e;
|
|
55
|
+
}
|
|
56
|
+
function O(e) {
|
|
36
57
|
let t = new RegExp("^([a-z|A-Z]+)\\<(.+)\\>$").exec(e);
|
|
37
58
|
if (t && t.length > 0)
|
|
38
59
|
return {
|
|
39
|
-
own:
|
|
60
|
+
own: A(t[1]),
|
|
40
61
|
son: t[2]
|
|
41
62
|
};
|
|
42
63
|
}
|
|
43
|
-
function
|
|
44
|
-
let t =
|
|
45
|
-
t ? (n.push(t.own), t.son &&
|
|
64
|
+
function b(e, n) {
|
|
65
|
+
let t = O(e);
|
|
66
|
+
t ? (n.push(t.own), t.son && b(t.son, n)) : n.push(e);
|
|
46
67
|
}
|
|
47
|
-
function
|
|
68
|
+
function T(e) {
|
|
48
69
|
e instanceof Array && (e = e[0]);
|
|
49
70
|
const n = [];
|
|
50
|
-
return e &&
|
|
71
|
+
return e && b(e, n), n;
|
|
51
72
|
}
|
|
52
|
-
function
|
|
73
|
+
function W(e) {
|
|
53
74
|
const n = Object.prototype.toString.call(e);
|
|
54
75
|
let r = /^\[[O|o]bject (.*)\]$/.exec(n), i = typeof e;
|
|
55
76
|
return r && r.length > 0 && (i = r[1].toLowerCase()), i;
|
|
56
77
|
}
|
|
57
|
-
function
|
|
58
|
-
const t =
|
|
78
|
+
function M(e, n) {
|
|
79
|
+
const t = W(e), r = T(n)[0];
|
|
59
80
|
return r && r != "any" ? t == r : !0;
|
|
60
81
|
}
|
|
61
|
-
function
|
|
82
|
+
function V(e) {
|
|
62
83
|
if (typeof e == "string") {
|
|
63
84
|
let n = !1;
|
|
64
85
|
return (/^\'(.|\n|\r)*\'$/.test(e) || /^\"(.|\n|\r)*\"$/.test(e) || /^\`(.|\n|\r)*\`$/.test(e)) && (n = !0), n && (e = e.substring(1, e.length - 1)), e + "";
|
|
65
86
|
} else return typeof e == "object" && e ? e.toString() : typeof e > "u" || typeof e == "object" && !e ? "" : e + "";
|
|
66
87
|
}
|
|
67
|
-
function
|
|
88
|
+
function Z(e) {
|
|
68
89
|
const n = typeof e;
|
|
69
90
|
if (n == "string") {
|
|
70
91
|
e = (e + "").replace(/^(\s|\n|r)*/, "").replace(/(\s|\n|r)*$/, "");
|
|
@@ -73,7 +94,7 @@ function N(e) {
|
|
|
73
94
|
} else
|
|
74
95
|
return n === "object" ? e instanceof Array ? "array" : n === null ? "null" : n : n;
|
|
75
96
|
}
|
|
76
|
-
function
|
|
97
|
+
function k(e) {
|
|
77
98
|
const n = e[0] || "any";
|
|
78
99
|
let t = n.split("<")[0];
|
|
79
100
|
switch (t = t.trim().toLowerCase(), t) {
|
|
@@ -86,8 +107,8 @@ function O(e) {
|
|
|
86
107
|
case "array":
|
|
87
108
|
let r = n.indexOf("<"), i = n.substring(n.indexOf("<") + 1, n.length - 1) || "";
|
|
88
109
|
r == -1 && (i = "any");
|
|
89
|
-
let
|
|
90
|
-
return
|
|
110
|
+
let o = k($(i).dataType);
|
|
111
|
+
return o = o == "undefined" ? "" : o, `[${o}]`;
|
|
91
112
|
case "object":
|
|
92
113
|
return "{}";
|
|
93
114
|
case "function":
|
|
@@ -98,25 +119,25 @@ function O(e) {
|
|
|
98
119
|
return "undefined";
|
|
99
120
|
}
|
|
100
121
|
}
|
|
101
|
-
function
|
|
122
|
+
function G(e) {
|
|
102
123
|
let n = "";
|
|
103
124
|
return e.forEach((t, r) => {
|
|
104
125
|
t = t.trim(), t && (n && (n += " | "), t === "Array" ? n += "Array<any>" : n += t);
|
|
105
126
|
}), n || "any";
|
|
106
127
|
}
|
|
107
|
-
const
|
|
128
|
+
const g = (e, n) => {
|
|
108
129
|
let t = [], r = [], i = "";
|
|
109
|
-
for (let
|
|
110
|
-
const s = e[
|
|
130
|
+
for (let o = 0; o < e.length; o++) {
|
|
131
|
+
const s = e[o];
|
|
111
132
|
s === "[" || s === "<" || s === "(" ? (t.push(s), i += s) : s === "]" && t.length > 0 && t[t.length - 1] === "[" || s === ">" && t.length > 0 && t[t.length - 1] === "<" || s === ")" && t.length > 0 && t[t.length - 1] === "(" ? (t.pop(), i += s) : s === n && t.length === 0 ? (r.push(i.trim()), i = "") : i += s;
|
|
112
133
|
}
|
|
113
134
|
return i.trim() !== "" && r.push(i.trim()), r;
|
|
114
|
-
},
|
|
135
|
+
}, $ = (e) => {
|
|
115
136
|
if (e)
|
|
116
137
|
if (e.startsWith("[") && e.endsWith("]") || e.startsWith("(") && e.endsWith(")")) {
|
|
117
138
|
const n = e.slice(1, -1).trim();
|
|
118
139
|
if (!n) return { type: "any", dataType: ["any"] };
|
|
119
|
-
const t =
|
|
140
|
+
const t = g(n, ",");
|
|
120
141
|
return {
|
|
121
142
|
type: t[0] || "any",
|
|
122
143
|
dataType: t
|
|
@@ -124,13 +145,13 @@ const f = (e, n) => {
|
|
|
124
145
|
} else if (e.startsWith("<") && e.endsWith(">")) {
|
|
125
146
|
const n = e.slice(1, -1).trim();
|
|
126
147
|
if (!n) return { type: "any", dataType: ["any"] };
|
|
127
|
-
const t =
|
|
148
|
+
const t = g(n, "|");
|
|
128
149
|
return {
|
|
129
150
|
type: t[0] || "any",
|
|
130
151
|
dataType: t
|
|
131
152
|
};
|
|
132
153
|
} else {
|
|
133
|
-
const n =
|
|
154
|
+
const n = g(e, ",");
|
|
134
155
|
return {
|
|
135
156
|
type: n[0] || "any",
|
|
136
157
|
dataType: n
|
|
@@ -138,45 +159,50 @@ const f = (e, n) => {
|
|
|
138
159
|
}
|
|
139
160
|
else return { type: "any", dataType: ["any"] };
|
|
140
161
|
};
|
|
141
|
-
function
|
|
142
|
-
return
|
|
162
|
+
function K(e) {
|
|
163
|
+
return g(e, ",").map((t) => {
|
|
143
164
|
const r = t.trim(), i = t.match(/^([^:?]+)(\??):/);
|
|
144
165
|
if (!i) return null;
|
|
145
|
-
const
|
|
146
|
-
let
|
|
147
|
-
for (let
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
|
|
166
|
+
const o = i[1].trim(), s = !i[2], j = i[0].length, p = t.substring(j).trim();
|
|
167
|
+
let l = [], h = "", m = "";
|
|
168
|
+
for (let a = 0; a < p.length; a++) {
|
|
169
|
+
const u = p[a];
|
|
170
|
+
if (u === "[" || u === "<" || u === "(" ? l.push(u) : (u === "]" && l[l.length - 1] === "[" || u === ">" && l[l.length - 1] === "<" || u === ")" && l[l.length - 1] === "(") && l.pop(), l.length === 0 && a > 0) {
|
|
171
|
+
a == 1 && u !== "]" && u !== ">" && u !== ")" ? (h = "", m = p.substring(0)) : (h = p.substring(0, a + 1).trim(), m = p.substring(a + 1));
|
|
151
172
|
break;
|
|
152
173
|
}
|
|
153
174
|
}
|
|
154
|
-
const { type:
|
|
175
|
+
const { type: C, dataType: d } = $(h), v = T(d);
|
|
155
176
|
return {
|
|
156
|
-
name:
|
|
157
|
-
prop:
|
|
158
|
-
type:
|
|
159
|
-
dataType:
|
|
177
|
+
name: o,
|
|
178
|
+
prop: o,
|
|
179
|
+
type: v[0],
|
|
180
|
+
dataType: d,
|
|
160
181
|
must: s,
|
|
161
182
|
label: r,
|
|
162
|
-
description:
|
|
183
|
+
description: m
|
|
163
184
|
};
|
|
164
185
|
}).filter(Boolean);
|
|
165
186
|
}
|
|
166
187
|
export {
|
|
167
188
|
x as getFunBody,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
R as
|
|
181
|
-
|
|
189
|
+
X as getFunctionFormat,
|
|
190
|
+
W as getObjType,
|
|
191
|
+
T as getSonType,
|
|
192
|
+
V as getString,
|
|
193
|
+
k as getTypeValue,
|
|
194
|
+
Z as isDefaultType,
|
|
195
|
+
M as isTypeEqual,
|
|
196
|
+
K as parseParamString,
|
|
197
|
+
$ as parseTypeDefinition,
|
|
198
|
+
N as prettierArrFormat,
|
|
199
|
+
I as prettierCss,
|
|
200
|
+
y as prettierFormat,
|
|
201
|
+
R as prettierFunFormat,
|
|
202
|
+
q as prettierHtml,
|
|
203
|
+
H as prettierJs,
|
|
204
|
+
L as prettierObjFormat,
|
|
205
|
+
z as prettierTs,
|
|
206
|
+
G as setDataType,
|
|
207
|
+
J as vueFormat
|
|
182
208
|
};
|
|
@@ -93,6 +93,8 @@ export type Resolve = {
|
|
|
93
93
|
};
|
|
94
94
|
export interface Config {
|
|
95
95
|
router?: string;
|
|
96
|
+
editortype?: string | number;
|
|
97
|
+
prettier?: boolean;
|
|
96
98
|
redirect?: boolean;
|
|
97
99
|
useparam?: boolean;
|
|
98
100
|
resolve?: Resolve[];
|
|
@@ -101,4 +103,4 @@ export interface Config {
|
|
|
101
103
|
example?: ExampleObj;
|
|
102
104
|
}
|
|
103
105
|
export declare function userConfig(defaultConfig: Config): Config;
|
|
104
|
-
export declare function getConfig(key: keyof Config): string | boolean | ExampleObj | Resolve[] | Components[] | undefined;
|
|
106
|
+
export declare function getConfig(key: keyof Config): string | number | boolean | ExampleObj | Resolve[] | Components[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),_=require("../../components/compo/code.vue.cjs");;/* empty css */const
|
|
1
|
+
"use strict";const e=require("vue"),_=require("../../components/compo/info.vue.cjs"),u=require("../../components/compo/code.vue.cjs");;/* empty css */const r=require("../../components/choice/index.vue.cjs"),n={class:"__document-com __document-edit"},c=e.defineComponent({__name:"index",setup(o){return(s,l)=>(e.openBlock(),e.createElementBlock("div",n,[e.createVNode(r,null,{default:e.withCtx(t=>[e.createVNode(_,{value:t.value},null,8,["value"]),e.createVNode(u,{istop:"",value:t.value},null,8,["value"])]),_:1})]))}});module.exports=c;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { defineComponent as o, createElementBlock as _, openBlock as n, createVNode as e, withCtx as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as o, createElementBlock as _, openBlock as n, createVNode as e, withCtx as m } from "vue";
|
|
2
|
+
import a from "../../components/compo/info.vue.js";
|
|
3
|
+
import l from "../../components/compo/code.vue.js";
|
|
3
4
|
/* empty css */
|
|
4
5
|
import r from "../../components/choice/index.vue.js";
|
|
5
|
-
const
|
|
6
|
+
const c = { class: "__document-com __document-edit" }, h = /* @__PURE__ */ o({
|
|
6
7
|
__name: "index",
|
|
7
8
|
setup(i) {
|
|
8
|
-
return (
|
|
9
|
+
return (u, s) => (n(), _("div", c, [
|
|
9
10
|
e(r, null, {
|
|
10
|
-
default:
|
|
11
|
-
e(
|
|
11
|
+
default: m((t) => [
|
|
12
|
+
e(a, {
|
|
13
|
+
value: t.value
|
|
14
|
+
}, null, 8, ["value"]),
|
|
15
|
+
e(l, {
|
|
12
16
|
istop: "",
|
|
13
17
|
value: t.value
|
|
14
18
|
}, null, 8, ["value"])
|
|
@@ -19,5 +23,5 @@ const a = { class: "__document-com __document-edit" }, v = /* @__PURE__ */ o({
|
|
|
19
23
|
}
|
|
20
24
|
});
|
|
21
25
|
export {
|
|
22
|
-
|
|
26
|
+
h as default
|
|
23
27
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangzhongya/vue-archive",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.70",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "vue 组件注释生成文档",
|
|
7
7
|
"author": "fangzhongya ",
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"@types/node": "^24.3.0",
|
|
26
26
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
27
27
|
"fast-glob": "^3.3.3",
|
|
28
|
+
"monaco-editor": "0.52.2",
|
|
29
|
+
"prettier": "3.6.2",
|
|
28
30
|
"sass": "^1.90.0",
|
|
29
31
|
"ts-node": "^10.9.2",
|
|
30
32
|
"tsup": "^8.5.0",
|
|
@@ -34,18 +36,17 @@
|
|
|
34
36
|
"vite-plugin-dts": "4.5.4",
|
|
35
37
|
"vitest": "^3.2.4",
|
|
36
38
|
"vue-router": "^4.5.1",
|
|
37
|
-
"vue-tsc": "^3.0.5"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
39
|
+
"vue-tsc": "^3.0.5",
|
|
40
40
|
"@codemirror/lang-css": "^6.3.1",
|
|
41
41
|
"@codemirror/lang-html": "^6.4.9",
|
|
42
42
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
43
43
|
"@codemirror/lang-json": "^6.0.2",
|
|
44
44
|
"@codemirror/state": "^6.5.2",
|
|
45
45
|
"@codemirror/view": "^6.38.1",
|
|
46
|
-
"codemirror": "^6.0.2"
|
|
46
|
+
"codemirror": "^6.0.2"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
47
49
|
"comment-parser": "^1.4.1",
|
|
48
|
-
"es-module-lexer": "^1.7.0",
|
|
49
50
|
"highlight.js": "^11.11.1",
|
|
50
51
|
"markdown-it": "^14.1.0",
|
|
51
52
|
"vue": "^3.5.18"
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@codemirror/view"),n=require("@codemirror/lang-javascript");require("@codemirror/lang-html");require("@codemirror/lang-json");require("@codemirror/lang-css");const a=require("@codemirror/state"),f=require("codemirror"),u=(t,{onUpdate:r,onChange:i,onFocus:s,onBlur:o})=>a.EditorState.create({doc:`
|
|
2
|
-
|
|
3
|
-
`,extensions:[...t,f.basicSetup,c.EditorView.updateListener.of(e=>{r&&r(e),e.docChanged&&i&&i(e.state.doc.toString(),e),e.focusChanged&&(e.view.hasFocus?s&&s(e):o&&o(e))})]});function g(t,r){return new c.EditorView({state:u([n.javascript()],r),parent:t})}exports.createEditorState=u;exports.getJs=g;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { EditorView as m } from "@codemirror/view";
|
|
2
|
-
import { javascript as c } from "@codemirror/lang-javascript";
|
|
3
|
-
import "@codemirror/lang-html";
|
|
4
|
-
import "@codemirror/lang-json";
|
|
5
|
-
import "@codemirror/lang-css";
|
|
6
|
-
import { EditorState as e } from "@codemirror/state";
|
|
7
|
-
import { basicSetup as n } from "codemirror";
|
|
8
|
-
const u = (o, { onUpdate: r, onChange: i, onFocus: f, onBlur: s }) => e.create({
|
|
9
|
-
doc: `
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
extensions: [
|
|
13
|
-
...o,
|
|
14
|
-
n,
|
|
15
|
-
m.updateListener.of((t) => {
|
|
16
|
-
r && r(t), t.docChanged && i && i(t.state.doc.toString(), t), t.focusChanged && (t.view.hasFocus ? f && f(t) : s && s(t));
|
|
17
|
-
})
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
function b(o, r) {
|
|
21
|
-
return new m({
|
|
22
|
-
// 状态
|
|
23
|
-
state: u([c()], r),
|
|
24
|
-
// 绑定元素
|
|
25
|
-
parent: o
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
u as createEditorState,
|
|
30
|
-
b as getJs
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),p=require("../../codemirror.cjs"),f=e.defineComponent({__name:"codemirror",props:{modelValue:{type:null},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(s,{emit:i}){const u=s,l=i,r=e.ref(),d=e.ref();function a(n){const t=n.view,c=t.state.doc,m=c.toString().trim();let o=u.check(m);o&&(t.dispatch({changes:{from:0,to:c.length,insert:o}}),l("update:modelValue",o))}return e.onMounted(()=>{d.value=p.getJs(r.value,{onBlur:a})}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:"codemirror-div",ref_key:"refText",ref:r},null,512))}});module.exports=f;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, ref as c, onMounted as f, createElementBlock as v, openBlock as _ } from "vue";
|
|
2
|
-
import { getJs as h } from "../../codemirror.js";
|
|
3
|
-
const x = /* @__PURE__ */ p({
|
|
4
|
-
__name: "codemirror",
|
|
5
|
-
props: {
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: null
|
|
8
|
-
},
|
|
9
|
-
check: {
|
|
10
|
-
type: Function,
|
|
11
|
-
default() {
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
emits: ["update:modelValue"],
|
|
17
|
-
setup(i, { emit: l }) {
|
|
18
|
-
const s = i, u = l, o = c(), a = c();
|
|
19
|
-
function m(n) {
|
|
20
|
-
const e = n.view, r = e.state.doc, d = r.toString().trim();
|
|
21
|
-
let t = s.check(d);
|
|
22
|
-
t && (e.dispatch({
|
|
23
|
-
changes: {
|
|
24
|
-
from: 0,
|
|
25
|
-
to: r.length,
|
|
26
|
-
insert: t
|
|
27
|
-
}
|
|
28
|
-
}), u("update:modelValue", t));
|
|
29
|
-
}
|
|
30
|
-
return f(() => {
|
|
31
|
-
a.value = h(o.value, {
|
|
32
|
-
onBlur: m
|
|
33
|
-
});
|
|
34
|
-
}), (n, e) => (_(), v("div", {
|
|
35
|
-
class: "codemirror-div",
|
|
36
|
-
ref_key: "refText",
|
|
37
|
-
ref: o
|
|
38
|
-
}, null, 512));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
export {
|
|
42
|
-
x as default
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./codemirror.vue.cjs");module.exports=e;
|
/package/dist/packages/components/use/{codemirror.d.ts → retrie/input/codemirror/codemirror.d.ts}
RENAMED
|
File without changes
|