@fangzhongya/vue-archive 0.0.71 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/components/use/code.d.ts +17 -25
- package/dist/packages/components/use/edit.cjs +7 -7
- package/dist/packages/components/use/edit.js +14 -12
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.cjs +1 -3
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.d.ts +5 -1
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.js +51 -35
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.cjs +5 -1
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.js +51 -36
- package/dist/packages/components/use/retrie/input/editor/editor.cjs +1 -3
- package/dist/packages/components/use/retrie/input/editor/editor.d.ts +5 -27
- package/dist/packages/components/use/retrie/input/editor/editor.js +22 -22
- package/dist/packages/components/use/retrie/input/editor/editor.vue.cjs +5 -1
- package/dist/packages/components/use/retrie/input/editor/editor.vue.js +36 -28
- package/dist/packages/components/use/retrie/input/index.d.ts +39 -3
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.js +31 -29
- package/dist/packages/components/use/retrie/input/text.d.ts +5 -11
- package/dist/packages/components/use/retrie/input/text.vue.cjs +5 -1
- package/dist/packages/components/use/retrie/input/text.vue.js +18 -20
- package/package.json +4 -3
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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): Promise<string>;
|
|
6
|
+
export declare function setValStringify(v: unknown, key: string, propsText?: ObjStr): string | Promise<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,9 +1,9 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),_=require("./code.vue.cjs"),f=require("./retrie/input/index.vue.cjs");;/* empty css */const g=require("./effect.vue.cjs"),d=require("./util.cjs");function b(c){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const
|
|
2
|
-
${
|
|
1
|
+
"use strict";const e=require("vue"),_=require("./code.vue.cjs"),f=require("./retrie/input/index.vue.cjs");;/* empty css */const g=require("./effect.vue.cjs"),d=require("./util.cjs");function b(c){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const l in c)if(l!=="default"){const u=Object.getOwnPropertyDescriptor(c,l);Object.defineProperty(a,l,u.get?u:{enumerable:!0,get:()=>c[l]})}}return a.default=c,Object.freeze(a)}const h=b(e),j=e.defineComponent({props:{value:{type:Object},param:{type:Object}},data(){return{template:"",script:"",style:"",vueHtml:""}},setup(c){function a(s){const r=document.getElementsByTagName("head")[0],i="data-vite-dev-id",o=s+".css",p=r.querySelector(`style[${i}="${o}"]`);if(p)return p;{let t=document.createElement("style");return t.appendChild(document.createTextNode("")),t.setAttribute("type","text/css"),t.setAttribute(i,o),r.appendChild(t),t}}async function l(s,r="",i){const o=[],p=c.value?.name;let t="";Object.keys(h).forEach(y=>{r.includes(y+"(")&&o.push(y)}),o.length>0&&(t=`import { ${o.join(" , ")} } from 'vue';`);let m=`<template>
|
|
2
|
+
${s}
|
|
3
3
|
</template>`;m=await d.prettierHtml(m);let v=`${t}
|
|
4
4
|
export default {
|
|
5
5
|
setup(props, ctx) {
|
|
6
|
-
${
|
|
6
|
+
${r}
|
|
7
7
|
}
|
|
8
8
|
}`;return v=await d.prettierJs(v),`<!--${p}-->
|
|
9
9
|
${m}
|
|
@@ -11,8 +11,8 @@ ${m}
|
|
|
11
11
|
${v}
|
|
12
12
|
<\/script>
|
|
13
13
|
<style>
|
|
14
|
-
${
|
|
14
|
+
${i}
|
|
15
15
|
</style>
|
|
16
|
-
`}function u(r,
|
|
17
|
-
const { ${
|
|
18
|
-
${
|
|
16
|
+
`}function u(s,r,i){try{const o=Object.keys(h);return new Function("props","ctx","vue",` "use strict";
|
|
17
|
+
const { ${o.join(",")} } = vue;
|
|
18
|
+
${s}; `)(r,i,h)}catch(o){console.error("Code block execution failed:",o)}}const n=e.ref(null);return e.onMounted(()=>{n.value=a(c.value?.key)}),{getHmtlVue:l,getCodeBlock:u,style:n}},render(c,a,l,u,n){const s=l.value||{};let r="div";s.component?r=e.defineAsyncComponent(s.component):s.name&&(r=e.resolveComponent(s.name));const i={};i[s.name]=r;const o=async()=>{const t=await u.getHmtlVue(n.template,n.script,n.style);n.vueHtml=t},p=()=>{u.style.innerHTML=n.style,o()};return e.h("div",{class:"code-edit"},[e.h("div",{class:"edit-effect use"},[e.h(g,{class:"use-component"},{default:()=>e.h(e.defineComponent({components:i,setup(t,m){return u.getCodeBlock(n.script,t,m)},template:n.template||"<div></div>"}))}),e.h(_,{html:n.vueHtml,name:s.name+"_edit",onRefresh:o})]),e.h("div",{class:"edit-input"},[e.h("div",{class:"but-div",onClick:p},"运行"),e.h("div",{},[e.h("div",{},"template"),e.h("div",{},e.h(f,{format:"html",check:t=>t,options:[s.name],modelValue:n.template,"onUpdate:modelValue":async t=>{n.template=await d.prettierHtml(t)}}))]),e.h("div",{},[e.h("div",{},"script"),e.h("div",{},"setup(props, ctx)"),e.h("div",{},e.h(f,{format:"js",check:t=>t,options:["props","ctx"],modelValue:n.script,"onUpdate:modelValue":async t=>{n.script=await d.prettierJs(t)}}))]),e.h("div",{},[e.h("div",{},"style"),e.h("div",{},e.h(f,{format:"css",check:t=>t,modelValue:n.style,"onUpdate:modelValue":async t=>{n.style=await d.prettierCss(t)}}))])])])}});module.exports=j;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as d from "vue";
|
|
2
|
-
import { defineComponent as h, defineAsyncComponent as C, resolveComponent as g, h as t, ref as
|
|
3
|
-
import
|
|
2
|
+
import { defineComponent as h, defineAsyncComponent as C, resolveComponent as g, h as t, ref as x, onMounted as b } from "vue";
|
|
3
|
+
import j from "./code.vue.js";
|
|
4
4
|
import v from "./retrie/input/index.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import H from "./effect.vue.js";
|
|
@@ -25,7 +25,7 @@ const U = h({
|
|
|
25
25
|
vueHtml: ""
|
|
26
26
|
};
|
|
27
27
|
},
|
|
28
|
-
setup(
|
|
28
|
+
setup(a) {
|
|
29
29
|
function f(o) {
|
|
30
30
|
const c = document.getElementsByTagName("head")[0], r = "data-vite-dev-id", s = o + ".css", l = c.querySelector(`style[${r}="${s}"]`);
|
|
31
31
|
if (l)
|
|
@@ -35,8 +35,8 @@ const U = h({
|
|
|
35
35
|
return e.appendChild(document.createTextNode("")), e.setAttribute("type", "text/css"), e.setAttribute(r, s), c.appendChild(e), e;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
async function
|
|
39
|
-
const s = [], l =
|
|
38
|
+
async function u(o, c = "", r) {
|
|
39
|
+
const s = [], l = a.value?.name;
|
|
40
40
|
let e = "";
|
|
41
41
|
Object.keys(d).forEach((y) => {
|
|
42
42
|
c.includes(y + "(") && s.push(y);
|
|
@@ -76,17 +76,17 @@ ${r}
|
|
|
76
76
|
console.error("Code block execution failed:", s);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const n =
|
|
80
|
-
return
|
|
81
|
-
n.value = f(
|
|
79
|
+
const n = x(null);
|
|
80
|
+
return b(() => {
|
|
81
|
+
n.value = f(a.value?.key);
|
|
82
82
|
}), {
|
|
83
|
-
getHmtlVue:
|
|
83
|
+
getHmtlVue: u,
|
|
84
84
|
getCodeBlock: i,
|
|
85
85
|
style: n
|
|
86
86
|
};
|
|
87
87
|
},
|
|
88
|
-
render(
|
|
89
|
-
const o =
|
|
88
|
+
render(a, f, u, i, n) {
|
|
89
|
+
const o = u.value || {};
|
|
90
90
|
let c = "div";
|
|
91
91
|
o.component ? c = C(o.component) : o.name && (c = g(o.name));
|
|
92
92
|
const r = {};
|
|
@@ -134,7 +134,7 @@ ${r}
|
|
|
134
134
|
)
|
|
135
135
|
}
|
|
136
136
|
),
|
|
137
|
-
t(
|
|
137
|
+
t(j, {
|
|
138
138
|
html: n.vueHtml,
|
|
139
139
|
name: o.name + "_edit",
|
|
140
140
|
onRefresh: s
|
|
@@ -163,6 +163,7 @@ ${r}
|
|
|
163
163
|
t(v, {
|
|
164
164
|
format: "html",
|
|
165
165
|
check: (e) => e,
|
|
166
|
+
options: [o.name],
|
|
166
167
|
modelValue: n.template,
|
|
167
168
|
"onUpdate:modelValue": async (e) => {
|
|
168
169
|
n.template = await $(e);
|
|
@@ -179,6 +180,7 @@ ${r}
|
|
|
179
180
|
t(v, {
|
|
180
181
|
format: "js",
|
|
181
182
|
check: (e) => e,
|
|
183
|
+
options: ["props", "ctx"],
|
|
182
184
|
modelValue: n.script,
|
|
183
185
|
"onUpdate:modelValue": async (e) => {
|
|
184
186
|
n.script = await k(e);
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
|
|
3
|
-
`,extensions:[...e,d.basicSetup,s.EditorView.updateListener.of(r=>{t&&t(r),r.docChanged&&n&&n(r.state.doc.toString(),r),r.focusChanged&&(r.view.hasFocus?o&&o(r):c&&c(r))})]});function E(e,t){return new s.EditorView({state:i([u.javascript()],t),parent:e})}function q(e,t){return new s.EditorView({state:i([a.html()],t),parent:e})}function S(e,t){return new s.EditorView({state:i([g.json()],t),parent:e})}function m(e,t){return new s.EditorView({state:i([f.css()],t),parent:e})}exports.createEditorState=i;exports.getCss=m;exports.getHtml=q;exports.getJs=E;exports.getJson=S;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@codemirror/view"),l=require("@codemirror/lang-javascript"),g=require("@codemirror/lang-html"),m=require("@codemirror/lang-json"),d=require("@codemirror/lang-css"),q=require("@codemirror/state"),E=require("codemirror"),S=require("@codemirror/autocomplete");function u(t){if(t){const e=t.map(n=>({label:n}));return n=>{let o=n.matchBefore(/\w*/);return!o||o.from==o.to&&!n.explicit?null:{from:o.from,options:e}}}return null}const s=(t,{onUpdate:e,onChange:c,onFocus:n,onBlur:o,value:a,options:f})=>(u(f),q.EditorState.create({doc:a,extensions:[...t,S.autocompletion({}),E.basicSetup,i.EditorView.updateListener.of(r=>{e&&e(r),r.docChanged&&c&&c(r.state.doc.toString(),r),r.focusChanged&&(r.view.hasFocus?n&&n(r):o&&o(r))})]}));function w(t,e){return new i.EditorView({state:s([l.javascript()],e),parent:t})}function J(t,e){return new i.EditorView({state:s([g.html()],e),parent:t})}function V(t,e){return new i.EditorView({state:s([m.json()],e),parent:t})}function b(t,e){return new i.EditorView({state:s([d.css()],e),parent:t})}exports.createEditorState=s;exports.getCss=b;exports.getHtml=J;exports.getJs=w;exports.getJson=V;exports.getOverride=u;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { EditorView, ViewUpdate } from '@codemirror/view';
|
|
2
2
|
import { EditorState, Extension, EditorStateConfig } from '@codemirror/state';
|
|
3
|
+
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
3
4
|
interface CreateStateOptions extends EditorStateConfig {
|
|
4
5
|
onChange?(doc: string, viewUpdate: ViewUpdate): void;
|
|
5
6
|
onUpdate?(viewUpdate: ViewUpdate): void;
|
|
6
7
|
onFocus?(viewUpdate: ViewUpdate): void;
|
|
7
8
|
onBlur?(viewUpdate: ViewUpdate): void;
|
|
9
|
+
value: string;
|
|
10
|
+
options?: string[];
|
|
8
11
|
}
|
|
9
|
-
export declare
|
|
12
|
+
export declare function getOverride(options?: string[]): ((context: CompletionContext) => CompletionResult | null) | null;
|
|
13
|
+
export declare const createEditorState: (extensions: Extension[], { onUpdate, onChange, onFocus, onBlur, value, options }: CreateStateOptions) => EditorState;
|
|
10
14
|
export declare function getJs(parent: Element, obj: CreateStateOptions): EditorView;
|
|
11
15
|
export declare function getHtml(parent: Element, obj: CreateStateOptions): EditorView;
|
|
12
16
|
export declare function getJson(parent: Element, obj: CreateStateOptions): EditorView;
|
|
@@ -1,58 +1,74 @@
|
|
|
1
|
-
import { EditorView as
|
|
2
|
-
import { javascript as
|
|
3
|
-
import { html as
|
|
4
|
-
import { json as
|
|
5
|
-
import { css as
|
|
1
|
+
import { EditorView as f } from "@codemirror/view";
|
|
2
|
+
import { javascript as c } from "@codemirror/lang-javascript";
|
|
3
|
+
import { html as a } from "@codemirror/lang-html";
|
|
4
|
+
import { json as l } from "@codemirror/lang-json";
|
|
5
|
+
import { css as p } from "@codemirror/lang-css";
|
|
6
6
|
import { EditorState as g } from "@codemirror/state";
|
|
7
|
-
import { basicSetup as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { basicSetup as h } from "codemirror";
|
|
8
|
+
import { autocompletion as S } from "@codemirror/autocomplete";
|
|
9
|
+
function d(t) {
|
|
10
|
+
if (t) {
|
|
11
|
+
const r = t.map((n) => ({
|
|
12
|
+
label: n
|
|
13
|
+
}));
|
|
14
|
+
return (n) => {
|
|
15
|
+
let e = n.matchBefore(/\w*/);
|
|
16
|
+
return !e || e.from == e.to && !n.explicit ? null : {
|
|
17
|
+
from: e.from,
|
|
18
|
+
options: r
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const i = (t, { onUpdate: r, onChange: m, onFocus: n, onBlur: e, value: s, options: u }) => (d(u), g.create({
|
|
25
|
+
doc: s,
|
|
12
26
|
extensions: [
|
|
13
|
-
...
|
|
14
|
-
S,
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
...t,
|
|
28
|
+
S({}),
|
|
29
|
+
h,
|
|
30
|
+
f.updateListener.of((o) => {
|
|
31
|
+
r && r(o), o.docChanged && m && m(o.state.doc.toString(), o), o.focusChanged && (o.view.hasFocus ? n && n(o) : e && e(o));
|
|
17
32
|
})
|
|
18
33
|
]
|
|
19
|
-
});
|
|
20
|
-
function
|
|
21
|
-
return new
|
|
34
|
+
}));
|
|
35
|
+
function L(t, r) {
|
|
36
|
+
return new f({
|
|
22
37
|
// 状态
|
|
23
|
-
state: i([
|
|
38
|
+
state: i([c()], r),
|
|
24
39
|
// 绑定元素
|
|
25
|
-
parent:
|
|
40
|
+
parent: t
|
|
26
41
|
});
|
|
27
42
|
}
|
|
28
|
-
function
|
|
29
|
-
return new
|
|
43
|
+
function O(t, r) {
|
|
44
|
+
return new f({
|
|
30
45
|
// 状态
|
|
31
|
-
state: i([
|
|
46
|
+
state: i([a()], r),
|
|
32
47
|
// 绑定元素
|
|
33
|
-
parent:
|
|
48
|
+
parent: t
|
|
34
49
|
});
|
|
35
50
|
}
|
|
36
|
-
function
|
|
37
|
-
return new
|
|
51
|
+
function V(t, r) {
|
|
52
|
+
return new f({
|
|
38
53
|
// 状态
|
|
39
|
-
state: i([
|
|
54
|
+
state: i([l()], r),
|
|
40
55
|
// 绑定元素
|
|
41
|
-
parent:
|
|
56
|
+
parent: t
|
|
42
57
|
});
|
|
43
58
|
}
|
|
44
|
-
function
|
|
45
|
-
return new
|
|
59
|
+
function k(t, r) {
|
|
60
|
+
return new f({
|
|
46
61
|
// 状态
|
|
47
|
-
state: i([
|
|
62
|
+
state: i([p()], r),
|
|
48
63
|
// 绑定元素
|
|
49
|
-
parent:
|
|
64
|
+
parent: t
|
|
50
65
|
});
|
|
51
66
|
}
|
|
52
67
|
export {
|
|
53
68
|
i as createEditorState,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
k as getCss,
|
|
70
|
+
O as getHtml,
|
|
71
|
+
L as getJs,
|
|
72
|
+
V as getJson,
|
|
73
|
+
d as getOverride
|
|
58
74
|
};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("vue"),f=require("../../../../../directives/adjust/index.cjs"),i=require("./codemirror.cjs"),v={class:"codemirror-div"},p=t.defineComponent({__name:"codemirror",props:{modelValue:{type:String,default:`
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
`},format:{type:String},options:{type:Array}},emits:["update:modelValue"],setup(c,{emit:u}){const e=c,m=u,n=t.ref(),r=t.ref();function a(o){const l=o.view.state.doc.toString().trim();l&&m("update:modelValue",l)}function d(){let o=e.modelValue,s=e.options;e.format==="js"||e.format==="ts"?r.value=i.getJs(n.value,{value:o,onBlur:a,options:s}):e.format==="css"||e.format==="scss"?r.value=i.getCss(n.value,{value:o,onBlur:a,options:s}):e.format==="html"||e.format==="vue"?r.value=i.getHtml(n.value,{value:o,onBlur:a,options:s}):e.format==="json"&&(r.value=i.getJson(n.value,{value:o,onBlur:a,options:s}))}return t.watch(()=>e.modelValue,()=>{r.value?.dispatch({changes:{from:0,to:r.value?.state.doc.length,insert:e.modelValue}})}),t.onMounted(()=>{d()}),(o,s)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{class:"codemirror-code",ref_key:"refText",ref:n},null,512)])),[[t.unref(f),{bottom:{}}]])}});module.exports=p;
|
|
@@ -1,62 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { getJs as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as f, ref as n, watch as d, onMounted as v, withDirectives as p, createElementBlock as g, openBlock as _, createElementVNode as h, unref as V } from "vue";
|
|
2
|
+
import w from "../../../../../directives/adjust/index.js";
|
|
3
|
+
import { getJs as y, getCss as x, getHtml as j, getJson as k } from "./codemirror.js";
|
|
4
|
+
const B = { class: "codemirror-div" }, J = /* @__PURE__ */ f({
|
|
5
5
|
__name: "codemirror",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: {
|
|
8
|
-
type:
|
|
8
|
+
type: String,
|
|
9
|
+
default: `
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
`
|
|
9
14
|
},
|
|
10
15
|
format: {
|
|
11
16
|
type: String
|
|
12
17
|
},
|
|
13
|
-
|
|
14
|
-
type:
|
|
15
|
-
default() {
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
+
options: {
|
|
19
|
+
type: Array
|
|
18
20
|
}
|
|
19
21
|
},
|
|
20
22
|
emits: ["update:modelValue"],
|
|
21
|
-
setup(
|
|
22
|
-
const e =
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
n && (s.dispatch({
|
|
27
|
-
changes: {
|
|
28
|
-
from: 0,
|
|
29
|
-
to: a.length,
|
|
30
|
-
insert: n
|
|
31
|
-
}
|
|
32
|
-
}), f("update:modelValue", n));
|
|
23
|
+
setup(i, { emit: m }) {
|
|
24
|
+
const e = i, c = m, s = n(), o = n();
|
|
25
|
+
function a(t) {
|
|
26
|
+
const l = t.view.state.doc.toString().trim();
|
|
27
|
+
l && c("update:modelValue", l);
|
|
33
28
|
}
|
|
34
29
|
function u() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onBlur:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
onBlur:
|
|
30
|
+
let t = e.modelValue, r = e.options;
|
|
31
|
+
e.format === "js" || e.format === "ts" ? o.value = y(s.value, {
|
|
32
|
+
value: t,
|
|
33
|
+
onBlur: a,
|
|
34
|
+
options: r
|
|
35
|
+
}) : e.format === "css" || e.format === "scss" ? o.value = x(s.value, {
|
|
36
|
+
value: t,
|
|
37
|
+
onBlur: a,
|
|
38
|
+
options: r
|
|
39
|
+
}) : e.format === "html" || e.format === "vue" ? o.value = j(s.value, {
|
|
40
|
+
value: t,
|
|
41
|
+
onBlur: a,
|
|
42
|
+
options: r
|
|
43
|
+
}) : e.format === "json" && (o.value = k(s.value, {
|
|
44
|
+
value: t,
|
|
45
|
+
onBlur: a,
|
|
46
|
+
options: r
|
|
43
47
|
}));
|
|
44
48
|
}
|
|
45
|
-
return
|
|
49
|
+
return d(
|
|
50
|
+
() => e.modelValue,
|
|
51
|
+
() => {
|
|
52
|
+
o.value?.dispatch({
|
|
53
|
+
changes: {
|
|
54
|
+
from: 0,
|
|
55
|
+
to: o.value?.state.doc.length,
|
|
56
|
+
insert: e.modelValue
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
), v(() => {
|
|
46
61
|
u();
|
|
47
|
-
}), (
|
|
48
|
-
|
|
62
|
+
}), (t, r) => p((_(), g("div", B, [
|
|
63
|
+
h("div", {
|
|
49
64
|
class: "codemirror-code",
|
|
50
65
|
ref_key: "refText",
|
|
51
|
-
ref:
|
|
66
|
+
ref: s
|
|
52
67
|
}, null, 512)
|
|
53
68
|
])), [
|
|
54
|
-
[
|
|
69
|
+
[V(w), {
|
|
55
70
|
bottom: {}
|
|
56
71
|
}]
|
|
57
72
|
]);
|
|
58
73
|
}
|
|
59
74
|
});
|
|
60
75
|
export {
|
|
61
|
-
|
|
76
|
+
J as default
|
|
62
77
|
};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
|
|
3
|
-
`,lineNumbers:"on",automaticLayout:!0};function r(e){return t.editor.create(e,{...n,language:"typescript"})}function o(e){return t.editor.create(e,{...n,language:"html"})}function u(e){return t.editor.create(e,{...n,language:"json"})}function a(e){return t.editor.create(e,{...n,language:"css"})}exports.getCss=a;exports.getHtml=o;exports.getJs=r;exports.getJson=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("monaco-editor");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=u(a),o={theme:"vs",value:""};function g(e,t){return r.editor.create(e,{...o,value:t,language:"typescript"})}function s(e,t){return r.editor.create(e,{...o,value:t,language:"html"})}function i(e,t){return r.editor.create(e,{...o,value:t,language:"json"})}function l(e,t){return r.editor.create(e,{...o,value:t,language:"css"})}exports.getCss=l;exports.getHtml=s;exports.getJs=g;exports.getJson=i;
|
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function getJs(parent: HTMLElement): editor.IStandaloneCodeEditor;
|
|
3
|
-
export declare function getHtml(parent: HTMLElement): editor.IStandaloneCodeEditor;
|
|
4
|
-
export declare function getJson(parent: HTMLElement): editor.IStandaloneCodeEditor;
|
|
5
|
-
export declare function getCss(parent: HTMLElement): editor.IStandaloneCodeEditor;
|
|
6
|
-
;
|
|
7
|
-
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (...args: any[]) => void;
|
|
9
|
-
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: null;
|
|
12
|
-
};
|
|
13
|
-
format: {
|
|
14
|
-
type: StringConstructor;
|
|
15
|
-
};
|
|
16
|
-
check: {
|
|
17
|
-
type: FunctionConstructor;
|
|
18
|
-
default(): string;
|
|
19
|
-
};
|
|
20
|
-
}>> & Readonly<{
|
|
21
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
}>, {
|
|
23
|
-
check: Function;
|
|
24
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
25
|
-
refText: HTMLDivElement;
|
|
26
|
-
}, HTMLDivElement>;
|
|
27
|
-
export default _default;
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
|
2
|
+
export declare function getJs(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
3
|
+
export declare function getHtml(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
4
|
+
export declare function getJson(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
5
|
+
export declare function getCss(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import * as n from "monaco-editor";
|
|
2
|
+
const r = {
|
|
3
3
|
theme: "vs",
|
|
4
|
-
value:
|
|
5
|
-
|
|
6
|
-
`,
|
|
7
|
-
lineNumbers: "on",
|
|
8
|
-
automaticLayout: !0
|
|
4
|
+
value: ""
|
|
9
5
|
};
|
|
10
|
-
function
|
|
11
|
-
return
|
|
12
|
-
...
|
|
6
|
+
function o(e, t) {
|
|
7
|
+
return n.editor.create(e, {
|
|
8
|
+
...r,
|
|
9
|
+
value: t,
|
|
13
10
|
language: "typescript"
|
|
14
11
|
});
|
|
15
12
|
}
|
|
16
|
-
function a(e) {
|
|
17
|
-
return
|
|
18
|
-
...
|
|
13
|
+
function a(e, t) {
|
|
14
|
+
return n.editor.create(e, {
|
|
15
|
+
...r,
|
|
16
|
+
value: t,
|
|
19
17
|
language: "html"
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
24
|
-
...
|
|
20
|
+
function c(e, t) {
|
|
21
|
+
return n.editor.create(e, {
|
|
22
|
+
...r,
|
|
23
|
+
value: t,
|
|
25
24
|
language: "json"
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
30
|
-
...
|
|
27
|
+
function g(e, t) {
|
|
28
|
+
return n.editor.create(e, {
|
|
29
|
+
...r,
|
|
30
|
+
value: t,
|
|
31
31
|
language: "css"
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
g as getCss,
|
|
36
36
|
a as getHtml,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
o as getJs,
|
|
38
|
+
c as getJson
|
|
39
39
|
};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),
|
|
1
|
+
"use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),l=require("./editor.cjs"),d=require("./init.cjs"),v={class:"editor-div"},p=t.defineComponent({__name:"editor",props:{modelValue:{type:String,default:`
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
`},format:{type:String},options:{type:Array}},emits:["update:modelValue"],setup(n,{emit:u}){const e=n,i=u,s=t.ref(),r=t.shallowRef();function c(){d.init();const o=e.modelValue;e.format==="js"||e.format==="ts"?r.value=l.getJs(s.value,o):e.format==="css"||e.format==="scss"?r.value=l.getCss(s.value,o):e.format==="html"||e.format==="vue"?r.value=l.getHtml(s.value,o):e.format==="json"&&(r.value=l.getJson(s.value,o))}function f(o){o&&i("update:modelValue",o)}return t.watch(()=>e.modelValue,()=>{r.value?.setValue(e.modelValue)}),t.onMounted(()=>{c(),r.value?.onDidBlurEditorText(o=>{if(r.value){const a=r.value.getValue();f(a)}})}),(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{class:"editor-code",ref_key:"refText",ref:s},null,512)])),[[t.unref(m),{bottom:{}}]])}});module.exports=p;
|
|
@@ -1,53 +1,61 @@
|
|
|
1
|
-
import { defineComponent as m, ref as f, shallowRef as c,
|
|
2
|
-
import
|
|
3
|
-
import { getJs as
|
|
4
|
-
import { init as
|
|
5
|
-
const E = { class: "editor-div" },
|
|
1
|
+
import { defineComponent as m, ref as f, shallowRef as c, watch as d, onMounted as v, withDirectives as p, createElementBlock as V, openBlock as _, createElementVNode as g, unref as h } from "vue";
|
|
2
|
+
import x from "../../../../../directives/adjust/index.js";
|
|
3
|
+
import { getJs as y, getCss as B, getHtml as j, getJson as k } from "./editor.js";
|
|
4
|
+
import { init as w } from "./init.js";
|
|
5
|
+
const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
|
|
6
6
|
__name: "editor",
|
|
7
7
|
props: {
|
|
8
8
|
modelValue: {
|
|
9
|
-
type:
|
|
9
|
+
type: String,
|
|
10
|
+
default: `
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
`
|
|
10
15
|
},
|
|
11
16
|
format: {
|
|
12
17
|
type: String
|
|
13
18
|
},
|
|
14
|
-
|
|
15
|
-
type:
|
|
16
|
-
default() {
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
+
options: {
|
|
20
|
+
type: Array
|
|
19
21
|
}
|
|
20
22
|
},
|
|
21
23
|
emits: ["update:modelValue"],
|
|
22
|
-
setup(
|
|
23
|
-
const e =
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
setup(r, { emit: s }) {
|
|
25
|
+
const e = r, u = s, l = f(), o = c();
|
|
26
|
+
function i() {
|
|
27
|
+
w();
|
|
28
|
+
const t = e.modelValue;
|
|
29
|
+
e.format === "js" || e.format === "ts" ? o.value = y(l.value, t) : e.format === "css" || e.format === "scss" ? o.value = B(l.value, t) : e.format === "html" || e.format === "vue" ? o.value = j(l.value, t) : e.format === "json" && (o.value = k(l.value, t));
|
|
26
30
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
l && u("update:modelValue", l);
|
|
31
|
+
function n(t) {
|
|
32
|
+
t && u("update:modelValue", t);
|
|
30
33
|
}
|
|
31
|
-
return d(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
return d(
|
|
35
|
+
() => e.modelValue,
|
|
36
|
+
() => {
|
|
37
|
+
o.value?.setValue(e.modelValue);
|
|
38
|
+
}
|
|
39
|
+
), v(() => {
|
|
40
|
+
i(), o.value?.onDidBlurEditorText((t) => {
|
|
41
|
+
if (o.value) {
|
|
42
|
+
const a = o.value.getValue();
|
|
43
|
+
n(a);
|
|
36
44
|
}
|
|
37
45
|
});
|
|
38
|
-
}), (
|
|
39
|
-
|
|
46
|
+
}), (t, a) => p((_(), V("div", E, [
|
|
47
|
+
g("div", {
|
|
40
48
|
class: "editor-code",
|
|
41
49
|
ref_key: "refText",
|
|
42
|
-
ref:
|
|
50
|
+
ref: l
|
|
43
51
|
}, null, 512)
|
|
44
52
|
])), [
|
|
45
|
-
[
|
|
53
|
+
[h(x), {
|
|
46
54
|
bottom: {}
|
|
47
55
|
}]
|
|
48
56
|
]);
|
|
49
57
|
}
|
|
50
58
|
});
|
|
51
59
|
export {
|
|
52
|
-
|
|
60
|
+
J as default
|
|
53
61
|
};
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../../../vue/dist/vue.esm-bundler.js';
|
|
2
2
|
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
3
3
|
modelValue: {
|
|
4
|
-
type:
|
|
4
|
+
type: StringConstructor;
|
|
5
5
|
};
|
|
6
6
|
check: {
|
|
7
7
|
type: FunctionConstructor;
|
|
8
8
|
default(): string;
|
|
9
9
|
};
|
|
10
|
+
options: {
|
|
11
|
+
type: {
|
|
12
|
+
(arrayLength: number): string[];
|
|
13
|
+
(...items: string[]): string[];
|
|
14
|
+
new (arrayLength: number): string[];
|
|
15
|
+
new (...items: string[]): string[];
|
|
16
|
+
isArray(arg: any): arg is any[];
|
|
17
|
+
readonly prototype: any[];
|
|
18
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
19
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
20
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
21
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
22
|
+
of<T>(...items: T[]): T[];
|
|
23
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
24
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
25
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
10
28
|
format: {
|
|
11
29
|
type: StringConstructor;
|
|
12
30
|
default: string;
|
|
@@ -15,12 +33,30 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
15
33
|
"update:modelValue": (...args: any[]) => void;
|
|
16
34
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
17
35
|
modelValue: {
|
|
18
|
-
type:
|
|
36
|
+
type: StringConstructor;
|
|
19
37
|
};
|
|
20
38
|
check: {
|
|
21
39
|
type: FunctionConstructor;
|
|
22
40
|
default(): string;
|
|
23
41
|
};
|
|
42
|
+
options: {
|
|
43
|
+
type: {
|
|
44
|
+
(arrayLength: number): string[];
|
|
45
|
+
(...items: string[]): string[];
|
|
46
|
+
new (arrayLength: number): string[];
|
|
47
|
+
new (...items: string[]): string[];
|
|
48
|
+
isArray(arg: any): arg is any[];
|
|
49
|
+
readonly prototype: any[];
|
|
50
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
51
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
52
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
53
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
54
|
+
of<T>(...items: T[]): T[];
|
|
55
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
56
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
57
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
24
60
|
format: {
|
|
25
61
|
type: StringConstructor;
|
|
26
62
|
default: string;
|
|
@@ -28,7 +64,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
28
64
|
}>> & Readonly<{
|
|
29
65
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
30
66
|
}>, {
|
|
31
|
-
check: Function;
|
|
32
67
|
format: string;
|
|
68
|
+
check: Function;
|
|
33
69
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
34
70
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),s=require("./text.vue.cjs");;/* empty css */const m=require("./codemirror/codemirror.vue.cjs");;/* empty css */const d=require("./editor/editor.vue.cjs");;/* empty css */const
|
|
1
|
+
"use strict";const e=require("vue"),s=require("./text.vue.cjs");;/* empty css */const m=require("./codemirror/codemirror.vue.cjs");;/* empty css */const d=require("./editor/editor.vue.cjs");;/* empty css */const c=require("../../../../config.cjs"),_={class:"form-input"},v=e.defineComponent({__name:"index",props:{modelValue:{type:String},check:{type:Function,default(){return""}},options:{type:Array},format:{type:String,default:"js"}},emits:["update:modelValue"],setup(l,{emit:i}){const r=l,n=e.ref(c.getConfig("editortype")||0),p=i,t=e.computed({get(){return r.modelValue},set(a){p("update:modelValue",a)}});return(a,o)=>(e.openBlock(),e.createElementBlock("div",_,[n.value==1?(e.openBlock(),e.createBlock(m,{key:0,modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=u=>t.value=u),format:r.format,options:l.options},null,8,["modelValue","format","options"])):n.value==2?(e.openBlock(),e.createBlock(d,{key:1,modelValue:t.value,"onUpdate:modelValue":o[1]||(o[1]=u=>t.value=u),format:r.format,options:l.options},null,8,["modelValue","format","options"])):(e.openBlock(),e.createBlock(s,{key:2,modelValue:t.value,"onUpdate:modelValue":o[2]||(o[2]=u=>t.value=u)},null,8,["modelValue"]))]))}});module.exports=v;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as d, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as d, ref as s, computed as f, createElementBlock as V, openBlock as l, createBlock as n } from "vue";
|
|
2
|
+
import c from "./text.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
4
|
+
import v from "./codemirror/codemirror.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import
|
|
6
|
+
import y from "./editor/editor.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { getConfig as
|
|
9
|
-
const
|
|
8
|
+
import { getConfig as k } from "../../../../config.js";
|
|
9
|
+
const g = { class: "form-input" }, A = /* @__PURE__ */ d({
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
modelValue: {
|
|
13
|
-
type:
|
|
13
|
+
type: String
|
|
14
14
|
},
|
|
15
15
|
check: {
|
|
16
16
|
type: Function,
|
|
@@ -18,43 +18,45 @@ const _ = { class: "form-input" }, E = /* @__PURE__ */ d({
|
|
|
18
18
|
return "";
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
+
options: {
|
|
22
|
+
type: Array
|
|
23
|
+
},
|
|
21
24
|
format: {
|
|
22
25
|
type: String,
|
|
23
26
|
default: "js"
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
emits: ["update:modelValue"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
30
|
+
setup(m, { emit: i }) {
|
|
31
|
+
const a = m, r = s(k("editortype") || 0), p = i, e = f({
|
|
29
32
|
get() {
|
|
30
|
-
return
|
|
33
|
+
return a.modelValue;
|
|
31
34
|
},
|
|
32
|
-
set(
|
|
33
|
-
p("update:modelValue",
|
|
35
|
+
set(u) {
|
|
36
|
+
p("update:modelValue", u);
|
|
34
37
|
}
|
|
35
38
|
});
|
|
36
|
-
return (
|
|
37
|
-
|
|
39
|
+
return (u, o) => (l(), V("div", g, [
|
|
40
|
+
r.value == 1 ? (l(), n(v, {
|
|
38
41
|
key: 0,
|
|
39
|
-
modelValue:
|
|
40
|
-
"onUpdate:modelValue":
|
|
41
|
-
format:
|
|
42
|
-
|
|
43
|
-
}, null, 8, ["modelValue", "format", "
|
|
42
|
+
modelValue: e.value,
|
|
43
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => e.value = t),
|
|
44
|
+
format: a.format,
|
|
45
|
+
options: m.options
|
|
46
|
+
}, null, 8, ["modelValue", "format", "options"])) : r.value == 2 ? (l(), n(y, {
|
|
44
47
|
key: 1,
|
|
45
|
-
modelValue:
|
|
46
|
-
"onUpdate:modelValue":
|
|
47
|
-
format:
|
|
48
|
-
|
|
49
|
-
}, null, 8, ["modelValue", "format", "
|
|
48
|
+
modelValue: e.value,
|
|
49
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => e.value = t),
|
|
50
|
+
format: a.format,
|
|
51
|
+
options: m.options
|
|
52
|
+
}, null, 8, ["modelValue", "format", "options"])) : (l(), n(c, {
|
|
50
53
|
key: 2,
|
|
51
|
-
modelValue:
|
|
52
|
-
"onUpdate:modelValue":
|
|
53
|
-
|
|
54
|
-
}, null, 8, ["modelValue", "check"]))
|
|
54
|
+
modelValue: e.value,
|
|
55
|
+
"onUpdate:modelValue": o[2] || (o[2] = (t) => e.value = t)
|
|
56
|
+
}, null, 8, ["modelValue"]))
|
|
55
57
|
]));
|
|
56
58
|
}
|
|
57
59
|
});
|
|
58
60
|
export {
|
|
59
|
-
|
|
61
|
+
A as default
|
|
60
62
|
};
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../../../vue/dist/vue.esm-bundler.js';
|
|
2
2
|
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
3
3
|
modelValue: {
|
|
4
|
-
type:
|
|
5
|
-
|
|
6
|
-
check: {
|
|
7
|
-
type: FunctionConstructor;
|
|
8
|
-
default(): string;
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
9
6
|
};
|
|
10
7
|
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
11
8
|
"update:modelValue": (...args: any[]) => void;
|
|
12
9
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
13
10
|
modelValue: {
|
|
14
|
-
type:
|
|
15
|
-
|
|
16
|
-
check: {
|
|
17
|
-
type: FunctionConstructor;
|
|
18
|
-
default(): string;
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
19
13
|
};
|
|
20
14
|
}>> & Readonly<{
|
|
21
15
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
22
16
|
}>, {
|
|
23
|
-
|
|
17
|
+
modelValue: string;
|
|
24
18
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLTextAreaElement>;
|
|
25
19
|
export default _default;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),m=e.defineComponent({__name:"text",props:{modelValue:{type:String,default:`
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
`}},emits:["update:modelValue"],setup(u,{emit:n}){const o=u,a=n,l=e.ref(o.modelValue);e.watch(()=>o.modelValue,()=>{l.value=o.modelValue});async function s(r){const t=l.value;t&&a("update:modelValue",t)}return(r,t)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{class:"form-input-text",rows:"5","onUpdate:modelValue":t[0]||(t[0]=c=>l.value=c),onBlur:s},null,544)),[[e.vModelText,l.value]])}});module.exports=m;
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const V = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as s, ref as d, watch as p, withDirectives as c, createElementBlock as i, openBlock as f, vModelText as v } from "vue";
|
|
2
|
+
const V = /* @__PURE__ */ s({
|
|
3
3
|
__name: "text",
|
|
4
4
|
props: {
|
|
5
5
|
modelValue: {
|
|
6
|
-
type:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
6
|
+
type: String,
|
|
7
|
+
default: `
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
`
|
|
13
12
|
}
|
|
14
13
|
},
|
|
15
14
|
emits: ["update:modelValue"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
15
|
+
setup(o, { emit: a }) {
|
|
16
|
+
const l = o, u = a, t = d(l.modelValue);
|
|
18
17
|
p(
|
|
19
|
-
() =>
|
|
18
|
+
() => l.modelValue,
|
|
20
19
|
() => {
|
|
21
|
-
t.value =
|
|
20
|
+
t.value = l.modelValue;
|
|
22
21
|
}
|
|
23
22
|
);
|
|
24
|
-
async function r
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
o && n("update:modelValue", o);
|
|
23
|
+
async function n(r) {
|
|
24
|
+
const e = t.value;
|
|
25
|
+
e && u("update:modelValue", e);
|
|
28
26
|
}
|
|
29
|
-
return (
|
|
27
|
+
return (r, e) => c((f(), i("textarea", {
|
|
30
28
|
class: "form-input-text",
|
|
31
29
|
rows: "5",
|
|
32
|
-
"onUpdate:modelValue":
|
|
33
|
-
onBlur:
|
|
30
|
+
"onUpdate:modelValue": e[0] || (e[0] = (m) => t.value = m),
|
|
31
|
+
onBlur: n
|
|
34
32
|
}, null, 544)), [
|
|
35
33
|
[v, t.value]
|
|
36
34
|
]);
|
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.73",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "vue 组件注释生成文档",
|
|
7
7
|
"author": "fangzhongya ",
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
"vue-tsc": "^3.0.5"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"
|
|
41
|
-
"prettier": "^3.6.2",
|
|
40
|
+
"@codemirror/autocomplete": "6.18.6",
|
|
42
41
|
"@codemirror/lang-css": "^6.3.1",
|
|
43
42
|
"@codemirror/lang-html": "^6.4.9",
|
|
44
43
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
@@ -49,6 +48,8 @@
|
|
|
49
48
|
"comment-parser": "^1.4.1",
|
|
50
49
|
"highlight.js": "^11.11.1",
|
|
51
50
|
"markdown-it": "^14.1.0",
|
|
51
|
+
"monaco-editor": "^0.52.2",
|
|
52
|
+
"prettier": "^3.6.2",
|
|
52
53
|
"vue": "^3.5.18"
|
|
53
54
|
},
|
|
54
55
|
"types": "./dist/packages/index.d.ts",
|