@fangzhongya/vue-archive 0.0.71 → 0.0.72

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,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 s=require("@codemirror/view"),a=require("@codemirror/lang-javascript"),g=require("@codemirror/lang-html"),f=require("@codemirror/lang-json"),l=require("@codemirror/lang-css"),d=require("@codemirror/state"),E=require("codemirror"),i=(e,{onUpdate:t,onChange:n,onFocus:o,onBlur:c,value:u})=>d.EditorState.create({doc:u,extensions:[...e,E.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 q(e,t){return new s.EditorView({state:i([a.javascript()],t),parent:e})}function S(e,t){return new s.EditorView({state:i([g.html()],t),parent:e})}function m(e,t){return new s.EditorView({state:i([f.json()],t),parent:e})}function J(e,t){return new s.EditorView({state:i([l.css()],t),parent:e})}exports.createEditorState=i;exports.getCss=J;exports.getHtml=S;exports.getJs=q;exports.getJson=m;
@@ -5,8 +5,9 @@ interface CreateStateOptions extends EditorStateConfig {
5
5
  onUpdate?(viewUpdate: ViewUpdate): void;
6
6
  onFocus?(viewUpdate: ViewUpdate): void;
7
7
  onBlur?(viewUpdate: ViewUpdate): void;
8
+ value: string;
8
9
  }
9
- export declare const createEditorState: (extensions: Extension[], { onUpdate, onChange, onFocus, onBlur }: CreateStateOptions) => EditorState;
10
+ export declare const createEditorState: (extensions: Extension[], { onUpdate, onChange, onFocus, onBlur, value }: CreateStateOptions) => EditorState;
10
11
  export declare function getJs(parent: Element, obj: CreateStateOptions): EditorView;
11
12
  export declare function getHtml(parent: Element, obj: CreateStateOptions): EditorView;
12
13
  export declare function getJson(parent: Element, obj: CreateStateOptions): EditorView;
@@ -1,30 +1,20 @@
1
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";
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
- `,
2
+ import { javascript as c } from "@codemirror/lang-javascript";
3
+ import { html as u } from "@codemirror/lang-html";
4
+ import { json as a } from "@codemirror/lang-json";
5
+ import { css as g } from "@codemirror/lang-css";
6
+ import { EditorState as S } from "@codemirror/state";
7
+ import { basicSetup as h } from "codemirror";
8
+ const i = (r, { onUpdate: t, onChange: n, onFocus: s, onBlur: f, value: m }) => S.create({
9
+ doc: m,
12
10
  extensions: [
13
11
  ...r,
14
- S,
12
+ h,
15
13
  e.updateListener.of((o) => {
16
14
  t && t(o), o.docChanged && n && n(o.state.doc.toString(), o), o.focusChanged && (o.view.hasFocus ? s && s(o) : f && f(o));
17
15
  })
18
16
  ]
19
17
  });
20
- function J(r, t) {
21
- return new e({
22
- // 状态
23
- state: i([m()], t),
24
- // 绑定元素
25
- parent: r
26
- });
27
- }
28
18
  function b(r, t) {
29
19
  return new e({
30
20
  // 状态
@@ -49,10 +39,18 @@ function H(r, t) {
49
39
  parent: r
50
40
  });
51
41
  }
42
+ function L(r, t) {
43
+ return new e({
44
+ // 状态
45
+ state: i([g()], t),
46
+ // 绑定元素
47
+ parent: r
48
+ });
49
+ }
52
50
  export {
53
51
  i as createEditorState,
54
- H as getCss,
55
- b as getHtml,
56
- J as getJs,
57
- d as getJson
52
+ L as getCss,
53
+ d as getHtml,
54
+ b as getJs,
55
+ H as getJson
58
56
  };
@@ -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"),c=require("./codemirror.cjs"),v={class:"codemirror-div"},p=t.defineComponent({__name:"codemirror",props:{modelValue:{type:String,default:`
2
+
3
+
4
+
5
+ `},format:{type:String}},emits:["update:modelValue"],setup(n,{emit:i}){const e=n,u=i,s=t.ref(),r=t.ref();function a(o){const l=o.view.state.doc.toString().trim();l&&u("update:modelValue",l)}function m(){let o=e.modelValue;e.format==="js"||e.format==="ts"?r.value=c.getJs(s.value,{value:o,onBlur:a}):e.format==="css"||e.format==="scss"?r.value=c.getCss(s.value,{value:o,onBlur:a}):e.format==="html"||e.format==="vue"?r.value=c.getHtml(s.value,{value:o,onBlur:a}):e.format==="json"&&(r.value=c.getJson(s.value,{value:o,onBlur:a}))}return t.watch(()=>e.modelValue,()=>{r.value?.dispatch({changes:{from:0,to:r.value?.state.doc.length,insert:e.modelValue}})}),t.onMounted(()=>{m()}),(o,d)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{class:"codemirror-code",ref_key:"refText",ref:s},null,512)])),[[t.unref(f),{bottom:{}}]])}});module.exports=p;
@@ -1,62 +1,70 @@
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 l, 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 x, getCss as j, getHtml as k, getJson as y } from "./codemirror.js";
4
+ const B = { class: "codemirror-div" }, T = /* @__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
- },
13
- check: {
14
- type: Function,
15
- default() {
16
- return "";
17
- }
18
17
  }
19
18
  },
20
19
  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));
20
+ setup(m, { emit: n }) {
21
+ const e = m, c = n, r = l(), o = l();
22
+ function a(t) {
23
+ const s = t.view.state.doc.toString().trim();
24
+ s && c("update:modelValue", s);
33
25
  }
34
- 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
26
+ function i() {
27
+ let t = e.modelValue;
28
+ e.format === "js" || e.format === "ts" ? o.value = x(r.value, {
29
+ value: t,
30
+ onBlur: a
31
+ }) : e.format === "css" || e.format === "scss" ? o.value = j(r.value, {
32
+ value: t,
33
+ onBlur: a
34
+ }) : e.format === "html" || e.format === "vue" ? o.value = k(r.value, {
35
+ value: t,
36
+ onBlur: a
37
+ }) : e.format === "json" && (o.value = y(r.value, {
38
+ value: t,
39
+ onBlur: a
43
40
  }));
44
41
  }
45
- return v(() => {
46
- u();
47
- }), (c, s) => h((g(), _("div", C, [
48
- k("div", {
42
+ return d(
43
+ () => e.modelValue,
44
+ () => {
45
+ o.value?.dispatch({
46
+ changes: {
47
+ from: 0,
48
+ to: o.value?.state.doc.length,
49
+ insert: e.modelValue
50
+ }
51
+ });
52
+ }
53
+ ), v(() => {
54
+ i();
55
+ }), (t, u) => p((_(), g("div", B, [
56
+ h("div", {
49
57
  class: "codemirror-code",
50
58
  ref_key: "refText",
51
- ref: t
59
+ ref: r
52
60
  }, null, 512)
53
61
  ])), [
54
- [x(y), {
62
+ [V(w), {
55
63
  bottom: {}
56
64
  }]
57
65
  ]);
58
66
  }
59
67
  });
60
68
  export {
61
- S as default
69
+ T as default
62
70
  };
@@ -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 n=require("monaco-editor/esm/vs/editor/editor.api"),r={theme:"vs",value:""};function g(e,t){return n.editor.create(e,{...r,value:t,language:"typescript"})}function o(e,t){return n.editor.create(e,{...r,value:t,language:"html"})}function s(e,t){return n.editor.create(e,{...r,value:t,language:"json"})}function u(e,t){return n.editor.create(e,{...r,value:t,language:"css"})}exports.getCss=u;exports.getHtml=o;exports.getJs=g;exports.getJson=s;
@@ -1,27 +1,5 @@
1
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;
2
+ export declare function getJs(parent: HTMLElement, value: string): editor.IStandaloneCodeEditor;
3
+ export declare function getHtml(parent: HTMLElement, value: string): editor.IStandaloneCodeEditor;
4
+ export declare function getJson(parent: HTMLElement, value: string): editor.IStandaloneCodeEditor;
5
+ export declare function getCss(parent: HTMLElement, value: string): editor.IStandaloneCodeEditor;
@@ -1,39 +1,39 @@
1
- import { editor as t } from "monaco-editor/esm/vs/editor/editor.api";
2
- const n = {
1
+ import { editor as n } from "monaco-editor/esm/vs/editor/editor.api";
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 g(e, t) {
7
+ return n.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 u(e, t) {
14
+ return n.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.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 o(e, t) {
28
+ return n.create(e, {
29
+ ...r,
30
+ value: t,
31
31
  language: "css"
32
32
  });
33
33
  }
34
34
  export {
35
- c as getCss,
36
- a as getHtml,
37
- u as getJs,
38
- o as getJson
35
+ o as getCss,
36
+ u as getHtml,
37
+ g 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"),r=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}},emits:["update:modelValue"],setup(u,{emit:n}){const e=u,i=n,s=t.ref(),l=t.shallowRef();function c(){d.init();const o=e.modelValue;e.format==="js"||e.format==="ts"?l.value=r.getJs(s.value,o):e.format==="css"||e.format==="scss"?l.value=r.getCss(s.value,o):e.format==="html"||e.format==="vue"?l.value=r.getHtml(s.value,o):e.format==="json"&&(l.value=r.getJson(s.value,o))}function f(o){o&&i("update:modelValue",o)}return t.watch(()=>e.modelValue,()=>{l.value?.setValue(e.modelValue)}),t.onMounted(()=>{c(),l.value?.onDidBlurEditorText(o=>{if(l.value){const a=l.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,58 @@
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 n, 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 B, getCss as j, getHtml as k, getJson as w } from "./editor.js";
4
+ import { init as y } from "./init.js";
5
+ const E = { class: "editor-div" }, S = /* @__PURE__ */ n({
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
- },
14
- check: {
15
- type: Function,
16
- default() {
17
- return "";
18
- }
19
18
  }
20
19
  },
21
20
  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));
21
+ setup(r, { emit: s }) {
22
+ const e = r, u = s, l = f(), o = c();
23
+ function i() {
24
+ y();
25
+ const t = e.modelValue;
26
+ e.format === "js" || e.format === "ts" ? o.value = B(l.value, t) : e.format === "css" || e.format === "scss" ? o.value = j(l.value, t) : e.format === "html" || e.format === "vue" ? o.value = k(l.value, t) : e.format === "json" && (o.value = w(l.value, t));
26
27
  }
27
- function i(r) {
28
- let l = e.check(r);
29
- l && u("update:modelValue", l);
28
+ function m(t) {
29
+ t && u("update:modelValue", t);
30
30
  }
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);
31
+ return d(
32
+ () => e.modelValue,
33
+ () => {
34
+ o.value?.setValue(e.modelValue);
35
+ }
36
+ ), v(() => {
37
+ i(), o.value?.onDidBlurEditorText((t) => {
38
+ if (o.value) {
39
+ const a = o.value.getValue();
40
+ m(a);
36
41
  }
37
42
  });
38
- }), (r, l) => v((_(), p("div", E, [
39
- h("div", {
43
+ }), (t, a) => p((_(), V("div", E, [
44
+ g("div", {
40
45
  class: "editor-code",
41
46
  ref_key: "refText",
42
- ref: o
47
+ ref: l
43
48
  }, null, 512)
44
49
  ])), [
45
- [V(g), {
50
+ [h(x), {
46
51
  bottom: {}
47
52
  }]
48
53
  ]);
49
54
  }
50
55
  });
51
56
  export {
52
- F as default
57
+ S as default
53
58
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("monaco-editor/esm/vs/editor/editor.main"),t=require("monaco-editor/esm/vs/editor/editor.worker?worker"),n=require("monaco-editor/esm/vs/language/json/json.worker?worker"),s=require("monaco-editor/esm/vs/language/css/css.worker?worker"),i=require("monaco-editor/esm/vs/language/html/html.worker?worker"),o=require("monaco-editor/esm/vs/language/typescript/ts.worker?worker");function c(){self.MonacoEnvironment={getWorker(u,r){return r==="json"?new n:r==="css"||r==="scss"||r==="less"?new s:r==="html"||r==="handlebars"||r==="razor"?new i:r==="typescript"||r==="javascript"?new o:new t}},e.languages.typescript.typescriptDefaults.setEagerModelSync(!0)}exports.init=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("monaco-editor/esm/vs/editor/editor.main");function e(o){const r="/monaco-editor/esm/vs/",t=new Worker(`${r}${o}.js?type=module&worker_file`,{type:"module"});return t.onerror=()=>{},t.postMessage(""),t}const n=e("editor/editor.worker"),i=e("language/json/json.worker"),c=e("language/css/css.worker"),u=e("language/html/html.worker"),g=e("language/typescript/ts.worker");function a(){self.MonacoEnvironment={getWorker(o,r){return r==="json"?i:r==="css"||r==="scss"||r==="less"?c:r==="html"||r==="handlebars"||r==="razor"?u:r==="typescript"||r==="javascript"?g:n}},s.languages.typescript.typescriptDefaults.setEagerModelSync(!0)}exports.init=a;
@@ -1 +1,4 @@
1
+ /**
2
+ * 初始化
3
+ */
1
4
  export declare function init(): void;
@@ -1,16 +1,19 @@
1
- import { languages as t } from "monaco-editor/esm/vs/editor/editor.main";
2
- import o from "monaco-editor/esm/vs/editor/editor.worker?worker";
3
- import e from "monaco-editor/esm/vs/language/json/json.worker?worker";
4
- import n from "monaco-editor/esm/vs/language/css/css.worker?worker";
5
- import s from "monaco-editor/esm/vs/language/html/html.worker?worker";
6
- import i from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
7
- function w() {
1
+ import { languages as s } from "monaco-editor/esm/vs/editor/editor.main";
2
+ function e(t) {
3
+ const r = "/monaco-editor/esm/vs/", o = new Worker(`${r}${t}.js?type=module&worker_file`, {
4
+ type: "module"
5
+ });
6
+ return o.onerror = () => {
7
+ }, o.postMessage(""), o;
8
+ }
9
+ const n = e("editor/editor.worker"), c = e("language/json/json.worker"), i = e("language/css/css.worker"), u = e("language/html/html.worker"), k = e("language/typescript/ts.worker");
10
+ function p() {
8
11
  self.MonacoEnvironment = {
9
- getWorker(m, r) {
10
- return r === "json" ? new e() : r === "css" || r === "scss" || r === "less" ? new n() : r === "html" || r === "handlebars" || r === "razor" ? new s() : r === "typescript" || r === "javascript" ? new i() : new o();
12
+ getWorker(t, r) {
13
+ return r === "json" ? c : r === "css" || r === "scss" || r === "less" ? i : r === "html" || r === "handlebars" || r === "razor" ? u : r === "typescript" || r === "javascript" ? k : n;
11
14
  }
12
- }, t.typescript.typescriptDefaults.setEagerModelSync(!0);
15
+ }, s.typescript.typescriptDefaults.setEagerModelSync(!0);
13
16
  }
14
17
  export {
15
- w as init
18
+ p as init
16
19
  };
@@ -1,7 +1,7 @@
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;
@@ -15,7 +15,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
15
15
  "update:modelValue": (...args: any[]) => void;
16
16
  }, string, PublicProps, Readonly< ExtractPropTypes<{
17
17
  modelValue: {
18
- type: null;
18
+ type: StringConstructor;
19
19
  };
20
20
  check: {
21
21
  type: FunctionConstructor;
@@ -28,7 +28,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
28
28
  }>> & Readonly<{
29
29
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
30
30
  }>, {
31
- check: Function;
32
31
  format: string;
32
+ check: Function;
33
33
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
34
34
  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"),m=require("./text.vue.cjs");;/* empty css */const i=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""}},format:{type:String,default:"js"}},emits:["update:modelValue"],setup(a,{emit:p}){const l=a,r=e.ref(c.getConfig("editortype")||0),s=p,t=e.computed({get(){return l.modelValue},set(n){s("update:modelValue",n)}});return(n,o)=>(e.openBlock(),e.createElementBlock("div",_,[r.value==1?(e.openBlock(),e.createBlock(i,{key:0,modelValue:t.value,"onUpdate:modelValue":o[0]||(o[0]=u=>t.value=u),format:l.format},null,8,["modelValue","format"])):r.value==2?(e.openBlock(),e.createBlock(d,{key:1,modelValue:t.value,"onUpdate:modelValue":o[1]||(o[1]=u=>t.value=u),format:l.format},null,8,["modelValue","format"])):(e.openBlock(),e.createBlock(m,{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 i, ref as f, computed as s, createElementBlock as V, openBlock as l, createBlock as a } 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 _ } from "../../../../config.js";
9
+ const k = { class: "form-input" }, E = /* @__PURE__ */ i({
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,
@@ -24,34 +24,31 @@ const _ = { class: "form-input" }, E = /* @__PURE__ */ d({
24
24
  }
25
25
  },
26
26
  emits: ["update:modelValue"],
27
- setup(n, { emit: c }) {
28
- const e = n, u = i(y("editortype") || 0), p = c, o = f({
27
+ setup(n, { emit: p }) {
28
+ const m = n, r = f(_("editortype") || 0), d = p, e = s({
29
29
  get() {
30
- return e.modelValue;
30
+ return m.modelValue;
31
31
  },
32
- set(r) {
33
- p("update:modelValue", r);
32
+ set(u) {
33
+ d("update:modelValue", u);
34
34
  }
35
35
  });
36
- return (r, t) => (m(), s("div", _, [
37
- u.value == 1 ? (m(), a(V, {
36
+ return (u, t) => (l(), V("div", k, [
37
+ r.value == 1 ? (l(), a(v, {
38
38
  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, {
39
+ modelValue: e.value,
40
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => e.value = o),
41
+ format: m.format
42
+ }, null, 8, ["modelValue", "format"])) : r.value == 2 ? (l(), a(y, {
44
43
  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, {
44
+ modelValue: e.value,
45
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => e.value = o),
46
+ format: m.format
47
+ }, null, 8, ["modelValue", "format"])) : (l(), a(c, {
50
48
  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"]))
49
+ modelValue: e.value,
50
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => e.value = o)
51
+ }, null, 8, ["modelValue"]))
55
52
  ]));
56
53
  }
57
54
  });
@@ -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.72",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",