@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.
@@ -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): 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 i in c)if(i!=="default"){const u=Object.getOwnPropertyDescriptor(c,i);Object.defineProperty(a,i,u.get?u:{enumerable:!0,get:()=>c[i]})}}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(r){const o=document.getElementsByTagName("head")[0],l="data-vite-dev-id",s=r+".css",p=o.querySelector(`style[${l}="${s}"]`);if(p)return p;{let t=document.createElement("style");return t.appendChild(document.createTextNode("")),t.setAttribute("type","text/css"),t.setAttribute(l,s),o.appendChild(t),t}}async function i(r,o="",l){const s=[],p=c.value?.name;let t="";Object.keys(h).forEach(y=>{o.includes(y+"(")&&s.push(y)}),s.length>0&&(t=`import { ${s.join(" , ")} } from 'vue';`);let m=`<template>
2
- ${r}
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
- ${o}
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
- ${l}
14
+ ${i}
15
15
  </style>
16
- `}function u(r,o,l){try{const s=Object.keys(h);return new Function("props","ctx","vue",` "use strict";
17
- const { ${s.join(",")} } = vue;
18
- ${r}; `)(o,l,h)}catch(s){console.error("Code block execution failed:",s)}}const n=e.ref(null);return e.onMounted(()=>{n.value=a(c.value?.key)}),{getHmtlVue:i,getCodeBlock:u,style:n}},render(c,a,i,u,n){const r=i.value||{};let o="div";r.component?o=e.defineAsyncComponent(r.component):r.name&&(o=e.resolveComponent(r.name));const l={};l[r.name]=o;const s=async()=>{const t=await u.getHmtlVue(n.template,n.script,n.style);n.vueHtml=t},p=()=>{u.style.innerHTML=n.style,s()};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:l,setup(t,m){return u.getCodeBlock(n.script,t,m)},template:n.template||"<div></div>"}))}),e.h(_,{html:n.vueHtml,name:r.name+"_edit",onRefresh:s})]),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,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,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;
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 b, onMounted as j } from "vue";
3
- import x from "./code.vue.js";
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(u) {
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 a(o, c = "", r) {
39
- const s = [], l = u.value?.name;
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 = b(null);
80
- return j(() => {
81
- n.value = f(u.value?.key);
79
+ const n = x(null);
80
+ return b(() => {
81
+ n.value = f(a.value?.key);
82
82
  }), {
83
- getHmtlVue: a,
83
+ getHmtlVue: u,
84
84
  getCodeBlock: i,
85
85
  style: n
86
86
  };
87
87
  },
88
- render(u, f, a, i, n) {
89
- const o = a.value || {};
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(x, {
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 s=require("@codemirror/view"),u=require("@codemirror/lang-javascript"),a=require("@codemirror/lang-html"),g=require("@codemirror/lang-json"),f=require("@codemirror/lang-css"),l=require("@codemirror/state"),d=require("codemirror"),i=(e,{onUpdate:t,onChange:n,onFocus:o,onBlur:c})=>l.EditorState.create({doc:`
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 const createEditorState: (extensions: Extension[], { onUpdate, onChange, onFocus, onBlur }: CreateStateOptions) => EditorState;
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 e } from "@codemirror/view";
2
- import { javascript as m } from "@codemirror/lang-javascript";
3
- import { html as c } from "@codemirror/lang-html";
4
- import { json as u } from "@codemirror/lang-json";
5
- import { css as a } from "@codemirror/lang-css";
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 S } from "codemirror";
8
- const i = (r, { onUpdate: t, onChange: n, onFocus: s, onBlur: f }) => g.create({
9
- doc: `
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
- ...r,
14
- S,
15
- e.updateListener.of((o) => {
16
- t && t(o), o.docChanged && n && n(o.state.doc.toString(), o), o.focusChanged && (o.view.hasFocus ? s && s(o) : f && f(o));
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 J(r, t) {
21
- return new e({
34
+ }));
35
+ function L(t, r) {
36
+ return new f({
22
37
  // 状态
23
- state: i([m()], t),
38
+ state: i([c()], r),
24
39
  // 绑定元素
25
- parent: r
40
+ parent: t
26
41
  });
27
42
  }
28
- function b(r, t) {
29
- return new e({
43
+ function O(t, r) {
44
+ return new f({
30
45
  // 状态
31
- state: i([c()], t),
46
+ state: i([a()], r),
32
47
  // 绑定元素
33
- parent: r
48
+ parent: t
34
49
  });
35
50
  }
36
- function d(r, t) {
37
- return new e({
51
+ function V(t, r) {
52
+ return new f({
38
53
  // 状态
39
- state: i([u()], t),
54
+ state: i([l()], r),
40
55
  // 绑定元素
41
- parent: r
56
+ parent: t
42
57
  });
43
58
  }
44
- function H(r, t) {
45
- return new e({
59
+ function k(t, r) {
60
+ return new f({
46
61
  // 状态
47
- state: i([a()], t),
62
+ state: i([p()], r),
48
63
  // 绑定元素
49
- parent: r
64
+ parent: t
50
65
  });
51
66
  }
52
67
  export {
53
68
  i as createEditorState,
54
- H as getCss,
55
- b as getHtml,
56
- J as getJs,
57
- d as getJson
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 e=require("vue"),p=require("../../../../../directives/adjust/index.cjs"),n=require("./codemirror.cjs"),h={class:"codemirror-div"},_=e.defineComponent({__name:"codemirror",props:{modelValue:{type:null},format:{type:String},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(u,{emit:m}){const t=u,f=m,o=e.ref(),r=e.ref();function s(a){const c=a.view,l=c.state.doc,v=l.toString().trim();let i=t.check(v);i&&(c.dispatch({changes:{from:0,to:l.length,insert:i}}),f("update:modelValue",i))}function d(){t.format==="js"||t.format==="ts"?r.value=n.getJs(o.value,{onBlur:s}):t.format==="css"||t.format==="scss"?r.value=n.getCss(o.value,{onBlur:s}):t.format==="html"||t.format==="vue"?r.value=n.getHtml(o.value,{onBlur:s}):t.format==="json"&&(r.value=n.getJson(o.value,{onBlur:s}))}return e.onMounted(()=>{d()}),(a,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",{class:"codemirror-code",ref_key:"refText",ref:o},null,512)])),[[e.unref(p),{bottom:{}}]])}});module.exports=_;
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 p, ref as i, onMounted as v, withDirectives as h, createElementBlock as _, openBlock as g, createElementVNode as k, unref as x } from "vue";
2
- import y from "../../../../../directives/adjust/index.js";
3
- import { getJs as V, getCss as j, getHtml as w, getJson as B } from "./codemirror.js";
4
- const C = { class: "codemirror-div" }, S = /* @__PURE__ */ p({
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: null
8
+ type: String,
9
+ default: `
10
+
11
+
12
+
13
+ `
9
14
  },
10
15
  format: {
11
16
  type: String
12
17
  },
13
- check: {
14
- type: Function,
15
- default() {
16
- return "";
17
- }
18
+ options: {
19
+ type: Array
18
20
  }
19
21
  },
20
22
  emits: ["update:modelValue"],
21
- setup(l, { emit: m }) {
22
- const e = l, f = m, t = i(), o = i();
23
- function r(c) {
24
- const s = c.view, a = s.state.doc, d = a.toString().trim();
25
- let n = e.check(d);
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
- e.format === "js" || e.format === "ts" ? o.value = V(t.value, {
36
- onBlur: r
37
- }) : e.format === "css" || e.format === "scss" ? o.value = j(t.value, {
38
- onBlur: r
39
- }) : e.format === "html" || e.format === "vue" ? o.value = w(t.value, {
40
- onBlur: r
41
- }) : e.format === "json" && (o.value = B(t.value, {
42
- onBlur: r
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 v(() => {
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
- }), (c, s) => h((g(), _("div", C, [
48
- k("div", {
62
+ }), (t, r) => p((_(), g("div", B, [
63
+ h("div", {
49
64
  class: "codemirror-code",
50
65
  ref_key: "refText",
51
- ref: t
66
+ ref: s
52
67
  }, null, 512)
53
68
  ])), [
54
- [x(y), {
69
+ [V(w), {
55
70
  bottom: {}
56
71
  }]
57
72
  ]);
58
73
  }
59
74
  });
60
75
  export {
61
- S as default
76
+ J as default
62
77
  };
@@ -1,3 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("monaco-editor/esm/vs/editor/editor.api"),n={theme:"vs",value:`
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 { editor } from 'monaco-editor/esm/vs/editor/editor.api';
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 { editor as t } from "monaco-editor/esm/vs/editor/editor.api";
2
- const n = {
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 u(e) {
11
- return t.create(e, {
12
- ...n,
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 t.create(e, {
18
- ...n,
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 o(e) {
23
- return t.create(e, {
24
- ...n,
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 c(e) {
29
- return t.create(e, {
30
- ...n,
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
- c as getCss,
35
+ g as getCss,
36
36
  a as getHtml,
37
- u as getJs,
38
- o as getJson
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"),s=require("./editor.cjs"),d=require("./init.cjs"),v={class:"editor-div"},p=t.defineComponent({__name:"editor",props:{modelValue:{type:null},format:{type:String},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(u,{emit:a}){const e=u,i=a,r=t.ref(),o=t.shallowRef();function c(){d.init(),e.format==="js"||e.format==="ts"?o.value=s.getJs(r.value):e.format==="css"||e.format==="scss"?o.value=s.getCss(r.value):e.format==="html"||e.format==="vue"?o.value=s.getHtml(r.value):e.format==="json"&&(o.value=s.getJson(r.value))}function f(n){let l=e.check(n);l&&i("update:modelValue",l)}return t.onMounted(()=>{c(),o.value?.setValue(e.modelValue),o.value?.onDidBlurEditorText(n=>{if(o.value){const l=o.value.getValue();f(l)}})}),(n,l)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{class:"editor-code",ref_key:"refText",ref:r},null,512)])),[[t.unref(m),{bottom:{}}]])}});module.exports=p;
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, onMounted as d, withDirectives as v, createElementBlock as p, openBlock as _, createElementVNode as h, unref as V } from "vue";
2
- import g from "../../../../../directives/adjust/index.js";
3
- import { getJs as k, getCss as x, getHtml as y, getJson as B } from "./editor.js";
4
- import { init as j } from "./init.js";
5
- const E = { class: "editor-div" }, F = /* @__PURE__ */ m({
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: null
9
+ type: String,
10
+ default: `
11
+
12
+
13
+
14
+ `
10
15
  },
11
16
  format: {
12
17
  type: String
13
18
  },
14
- check: {
15
- type: Function,
16
- default() {
17
- return "";
18
- }
19
+ options: {
20
+ type: Array
19
21
  }
20
22
  },
21
23
  emits: ["update:modelValue"],
22
- setup(a, { emit: s }) {
23
- const e = a, u = s, o = f(), t = c();
24
- function n() {
25
- j(), e.format === "js" || e.format === "ts" ? t.value = k(o.value) : e.format === "css" || e.format === "scss" ? t.value = x(o.value) : e.format === "html" || e.format === "vue" ? t.value = y(o.value) : e.format === "json" && (t.value = B(o.value));
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 i(r) {
28
- let l = e.check(r);
29
- l && u("update:modelValue", l);
31
+ function n(t) {
32
+ t && u("update:modelValue", t);
30
33
  }
31
- return d(() => {
32
- n(), t.value?.setValue(e.modelValue), t.value?.onDidBlurEditorText((r) => {
33
- if (t.value) {
34
- const l = t.value.getValue();
35
- i(l);
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
- }), (r, l) => v((_(), p("div", E, [
39
- h("div", {
46
+ }), (t, a) => p((_(), V("div", E, [
47
+ g("div", {
40
48
  class: "editor-code",
41
49
  ref_key: "refText",
42
- ref: o
50
+ ref: l
43
51
  }, null, 512)
44
52
  ])), [
45
- [V(g), {
53
+ [h(x), {
46
54
  bottom: {}
47
55
  }]
48
56
  ]);
49
57
  }
50
58
  });
51
59
  export {
52
- F as default
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: null;
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: null;
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 i=require("../../../../config.cjs"),_={class:"form-input"},k=e.defineComponent({__name:"index",props:{modelValue:{type:null},check:{type:Function,default(){return""}},format:{type:String,default:"js"}},emits:["update:modelValue"],setup(n,{emit:a}){const t=n,r=e.ref(i.getConfig("editortype")||0),p=a,o=e.computed({get(){return t.modelValue},set(c){p("update:modelValue",c)}});return(c,u)=>(e.openBlock(),e.createElementBlock("div",_,[r.value==1?(e.openBlock(),e.createBlock(m,{key:0,modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=l=>o.value=l),format:t.format,check:t.check},null,8,["modelValue","format","check"])):r.value==2?(e.openBlock(),e.createBlock(d,{key:1,modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=l=>o.value=l),format:t.format,check:t.check},null,8,["modelValue","format","check"])):(e.openBlock(),e.createBlock(s,{key:2,modelValue:o.value,"onUpdate:modelValue":u[2]||(u[2]=l=>o.value=l),check:t.check},null,8,["modelValue","check"]))]))}});module.exports=k;
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 i, computed as f, createElementBlock as s, openBlock as m, createBlock as a } from "vue";
2
- import k from "./text.vue.js";
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 V from "./codemirror/codemirror.vue.js";
4
+ import v from "./codemirror/codemirror.vue.js";
5
5
  /* empty css */
6
- import v from "./editor/editor.vue.js";
6
+ import y from "./editor/editor.vue.js";
7
7
  /* empty css */
8
- import { getConfig as y } from "../../../../config.js";
9
- const _ = { class: "form-input" }, E = /* @__PURE__ */ d({
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: null
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(n, { emit: c }) {
28
- const e = n, u = i(y("editortype") || 0), p = c, o = f({
30
+ setup(m, { emit: i }) {
31
+ const a = m, r = s(k("editortype") || 0), p = i, e = f({
29
32
  get() {
30
- return e.modelValue;
33
+ return a.modelValue;
31
34
  },
32
- set(r) {
33
- p("update:modelValue", r);
35
+ set(u) {
36
+ p("update:modelValue", u);
34
37
  }
35
38
  });
36
- return (r, t) => (m(), s("div", _, [
37
- u.value == 1 ? (m(), a(V, {
39
+ return (u, o) => (l(), V("div", g, [
40
+ r.value == 1 ? (l(), n(v, {
38
41
  key: 0,
39
- modelValue: o.value,
40
- "onUpdate:modelValue": t[0] || (t[0] = (l) => o.value = l),
41
- format: e.format,
42
- check: e.check
43
- }, null, 8, ["modelValue", "format", "check"])) : u.value == 2 ? (m(), a(v, {
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: o.value,
46
- "onUpdate:modelValue": t[1] || (t[1] = (l) => o.value = l),
47
- format: e.format,
48
- check: e.check
49
- }, null, 8, ["modelValue", "format", "check"])) : (m(), a(k, {
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: o.value,
52
- "onUpdate:modelValue": t[2] || (t[2] = (l) => o.value = l),
53
- check: e.check
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
- E as default
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: null;
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: null;
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
- check: Function;
17
+ modelValue: string;
24
18
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLTextAreaElement>;
25
19
  export default _default;
@@ -1 +1,5 @@
1
- "use strict";const e=require("vue"),i=e.defineComponent({__name:"text",props:{modelValue:{type:null},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(n,{emit:a}){const t=n,c=a,l=e.ref(t.modelValue);e.watch(()=>t.modelValue,()=>{l.value=t.modelValue});async function r(s){const o=l.value;let u=await t.check(o);u&&c("update:modelValue",u)}return(s,o)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{class:"form-input-text",rows:"5","onUpdate:modelValue":o[0]||(o[0]=u=>l.value=u),onBlur:r},null,544)),[[e.vModelText,l.value]])}});module.exports=i;
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 m, ref as s, watch as p, withDirectives as d, createElementBlock as i, openBlock as f, vModelText as v } from "vue";
2
- const V = /* @__PURE__ */ m({
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: null
7
- },
8
- check: {
9
- type: Function,
10
- default() {
11
- return "";
12
- }
6
+ type: String,
7
+ default: `
8
+
9
+
10
+
11
+ `
13
12
  }
14
13
  },
15
14
  emits: ["update:modelValue"],
16
- setup(a, { emit: u }) {
17
- const e = a, n = u, t = s(e.modelValue);
15
+ setup(o, { emit: a }) {
16
+ const l = o, u = a, t = d(l.modelValue);
18
17
  p(
19
- () => e.modelValue,
18
+ () => l.modelValue,
20
19
  () => {
21
- t.value = e.modelValue;
20
+ t.value = l.modelValue;
22
21
  }
23
22
  );
24
- async function r(c) {
25
- const l = t.value;
26
- let o = await e.check(l);
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 (c, l) => d((f(), i("textarea", {
27
+ return (r, e) => c((f(), i("textarea", {
30
28
  class: "form-input-text",
31
29
  rows: "5",
32
- "onUpdate:modelValue": l[0] || (l[0] = (o) => t.value = o),
33
- onBlur: r
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.71",
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
- "monaco-editor": "^0.52.2",
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",