@fangzhongya/vue-archive 0.0.78 → 0.0.79
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/index.css +1 -1
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.d.ts +0 -41
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.js +16 -24
- package/package.json +5 -5
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.cjs +0 -1
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.js +0 -74
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.cjs +0 -5
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.js +0 -77
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.cjs +0 -1
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.js +0 -5
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.form-input-text{padding:10px;height:160px;width:100%;box-sizing:border-box}.
|
|
1
|
+
.form-input-text{padding:10px;height:160px;width:100%;box-sizing:border-box}.editor-div{padding:10px;height:160px;background-color:#eee}.editor-div .editor-code{height:100%;width:100%;min-height:80px;background-color:#fff}.form-input{font-size:16px}.form-select{position:relative;font-size:16px}.form-select .form-select-input{padding:10px;width:100%;font-size:16px;box-sizing:border-box}.form-select .form-select-box{position:absolute;width:100%;z-index:100;background-color:#000;text-align:center}.form-select .form-select-box .form-select-list-div{border:1px solid #000000}.form-select .form-select-box .form-select-list-div .form-select-list-li{background-color:#e9e9e9;padding:10px;cursor:pointer;border-bottom:1px solid #000000}.form-select{position:relative}.form-select .form-select-box{position:absolute;background-color:#fff;text-align:center}.form-select .form-select-box .form-select-list-div{border:1px solid #fff}.form-select .form-select-box .form-select-list-div .form-select-list-li{padding:10px;border-bottom:1px solid #eee}.form-select .form-select-box .form-select-list-div .form-select-list-li:last-child{border:0}.form-select .form-select-box .form-select-list-div .form-select-list-li.active{color:#0051ff}.form-boolean{display:flex;font-size:16px;padding:10px}.form-boolean .form-boolean-div{margin-right:10px}.form-string{font-size:16px}.form-string .form-string-text{padding:10px;width:100%;box-sizing:border-box}.form-number{font-size:16px}.form-number .form-number-input{padding:10px;width:100%;box-sizing:border-box}.set-emit .set-emit-li{padding:10px}.set-emit .set-emit-name{font-size:18px;padding:5px 0}.set-emit .set-emit-value{font-size:16px;background-color:azure}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
2
|
Theme: StackOverflow Light
|
|
3
3
|
Description: Light theme as used on stackoverflow.com
|
|
4
4
|
Author: stackoverflow.com
|
|
@@ -16,44 +16,3 @@ export declare function getHtml(parent: Element, obj: CreateStateOptions): Edito
|
|
|
16
16
|
export declare function getJson(parent: Element, obj: CreateStateOptions): EditorView;
|
|
17
17
|
export declare function getCss(parent: Element, obj: CreateStateOptions): EditorView;
|
|
18
18
|
export {};
|
|
19
|
-
>): Promise<T[]>;
|
|
20
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
21
|
-
readonly [Symbol.species]: ArrayConstructor;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
25
|
-
"update:modelValue": (...args: any[]) => void;
|
|
26
|
-
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
27
|
-
modelValue: {
|
|
28
|
-
type: StringConstructor;
|
|
29
|
-
default: string;
|
|
30
|
-
};
|
|
31
|
-
format: {
|
|
32
|
-
type: StringConstructor;
|
|
33
|
-
};
|
|
34
|
-
options: {
|
|
35
|
-
type: {
|
|
36
|
-
(arrayLength: number): string[];
|
|
37
|
-
(...items: string[]): string[];
|
|
38
|
-
new (arrayLength: number): string[];
|
|
39
|
-
new (...items: string[]): string[];
|
|
40
|
-
isArray(arg: any): arg is any[];
|
|
41
|
-
readonly prototype: any[];
|
|
42
|
-
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
43
|
-
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
44
|
-
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
45
|
-
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
46
|
-
of<T>(...items: T[]): T[];
|
|
47
|
-
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
48
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
49
|
-
readonly [Symbol.species]: ArrayConstructor;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
}>> & Readonly<{
|
|
53
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
54
|
-
}>, {
|
|
55
|
-
modelValue: string;
|
|
56
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
57
|
-
refText: HTMLDivElement;
|
|
58
|
-
}, HTMLDivElement>;
|
|
59
|
-
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),i=require("./text.vue.cjs");;/* empty css */const c=require("./editor/editor.vue.cjs");;/* empty css */const d=require("../../../../config.cjs"),m={class:"form-input"},_=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:a}){const r=l,s=e.ref(d.getConfig("editortype")||0),p=a,t=e.computed({get(){return r.modelValue},set(n){p("update:modelValue",n)}});return(n,o)=>(e.openBlock(),e.createElementBlock("div",m,[s.value==2?(e.openBlock(),e.createBlock(c,{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"])):(e.openBlock(),e.createBlock(i,{key:1,modelValue:t.value,"onUpdate:modelValue":o[1]||(o[1]=u=>t.value=u)},null,8,["modelValue"]))]))}});module.exports=_;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { defineComponent as d, ref as s, computed as f, createElementBlock as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as d, ref as s, computed as f, createElementBlock as c, openBlock as l, createBlock as r } from "vue";
|
|
2
|
+
import V from "./text.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import v from "./codemirror/codemirror.vue.js";
|
|
5
|
-
/* empty css */
|
|
6
4
|
import y from "./editor/editor.vue.js";
|
|
7
5
|
/* empty css */
|
|
8
|
-
import { getConfig as
|
|
9
|
-
const
|
|
6
|
+
import { getConfig as v } from "../../../../config.js";
|
|
7
|
+
const k = { class: "form-input" }, U = /* @__PURE__ */ d({
|
|
10
8
|
__name: "index",
|
|
11
9
|
props: {
|
|
12
10
|
modelValue: {
|
|
@@ -27,36 +25,30 @@ const g = { class: "form-input" }, A = /* @__PURE__ */ d({
|
|
|
27
25
|
}
|
|
28
26
|
},
|
|
29
27
|
emits: ["update:modelValue"],
|
|
30
|
-
setup(m, { emit:
|
|
31
|
-
const
|
|
28
|
+
setup(m, { emit: u }) {
|
|
29
|
+
const n = m, p = s(v("editortype") || 0), i = u, e = f({
|
|
32
30
|
get() {
|
|
33
|
-
return
|
|
31
|
+
return n.modelValue;
|
|
34
32
|
},
|
|
35
|
-
set(
|
|
36
|
-
|
|
33
|
+
set(a) {
|
|
34
|
+
i("update:modelValue", a);
|
|
37
35
|
}
|
|
38
36
|
});
|
|
39
|
-
return (
|
|
40
|
-
|
|
37
|
+
return (a, t) => (l(), c("div", k, [
|
|
38
|
+
p.value == 2 ? (l(), r(y, {
|
|
41
39
|
key: 0,
|
|
42
40
|
modelValue: e.value,
|
|
43
|
-
"onUpdate:modelValue":
|
|
44
|
-
format:
|
|
41
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => e.value = o),
|
|
42
|
+
format: n.format,
|
|
45
43
|
options: m.options
|
|
46
|
-
}, null, 8, ["modelValue", "format", "options"])) :
|
|
44
|
+
}, null, 8, ["modelValue", "format", "options"])) : (l(), r(V, {
|
|
47
45
|
key: 1,
|
|
48
46
|
modelValue: e.value,
|
|
49
|
-
"onUpdate:modelValue":
|
|
50
|
-
format: a.format,
|
|
51
|
-
options: m.options
|
|
52
|
-
}, null, 8, ["modelValue", "format", "options"])) : (l(), n(c, {
|
|
53
|
-
key: 2,
|
|
54
|
-
modelValue: e.value,
|
|
55
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => e.value = t)
|
|
47
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => e.value = o)
|
|
56
48
|
}, null, 8, ["modelValue"]))
|
|
57
49
|
]));
|
|
58
50
|
}
|
|
59
51
|
});
|
|
60
52
|
export {
|
|
61
|
-
|
|
53
|
+
U as default
|
|
62
54
|
};
|
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.79",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description ": "vue 组件注释生成文档",
|
|
7
7
|
"author": "fangzhongya ",
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"vite-plugin-dts": "4.5.4",
|
|
35
35
|
"vitest": "^3.2.4",
|
|
36
36
|
"vue-router": "^4.5.1",
|
|
37
|
-
"vue-tsc": "^3.0.5"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
37
|
+
"vue-tsc": "^3.0.5",
|
|
40
38
|
"@codemirror/autocomplete": "6.18.6",
|
|
41
39
|
"@codemirror/lang-css": "^6.3.1",
|
|
42
40
|
"@codemirror/lang-html": "^6.4.9",
|
|
@@ -44,7 +42,9 @@
|
|
|
44
42
|
"@codemirror/lang-json": "^6.0.2",
|
|
45
43
|
"@codemirror/state": "^6.5.2",
|
|
46
44
|
"@codemirror/view": "^6.38.1",
|
|
47
|
-
"codemirror": "^6.0.2"
|
|
45
|
+
"codemirror": "^6.0.2"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
48
|
"comment-parser": "^1.4.1",
|
|
49
49
|
"highlight.js": "^11.11.1",
|
|
50
50
|
"markdown-it": "^14.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
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,74 +0,0 @@
|
|
|
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
|
-
import { EditorState as g } from "@codemirror/state";
|
|
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,
|
|
26
|
-
extensions: [
|
|
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));
|
|
32
|
-
})
|
|
33
|
-
]
|
|
34
|
-
}));
|
|
35
|
-
function L(t, r) {
|
|
36
|
-
return new f({
|
|
37
|
-
// 状态
|
|
38
|
-
state: i([c()], r),
|
|
39
|
-
// 绑定元素
|
|
40
|
-
parent: t
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function O(t, r) {
|
|
44
|
-
return new f({
|
|
45
|
-
// 状态
|
|
46
|
-
state: i([a()], r),
|
|
47
|
-
// 绑定元素
|
|
48
|
-
parent: t
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function V(t, r) {
|
|
52
|
-
return new f({
|
|
53
|
-
// 状态
|
|
54
|
-
state: i([l()], r),
|
|
55
|
-
// 绑定元素
|
|
56
|
-
parent: t
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function k(t, r) {
|
|
60
|
-
return new f({
|
|
61
|
-
// 状态
|
|
62
|
-
state: i([p()], r),
|
|
63
|
-
// 绑定元素
|
|
64
|
-
parent: t
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
i as createEditorState,
|
|
69
|
-
k as getCss,
|
|
70
|
-
O as getHtml,
|
|
71
|
-
L as getJs,
|
|
72
|
-
V as getJson,
|
|
73
|
-
d as getOverride
|
|
74
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
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,77 +0,0 @@
|
|
|
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
|
-
__name: "codemirror",
|
|
6
|
-
props: {
|
|
7
|
-
modelValue: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: `
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`
|
|
14
|
-
},
|
|
15
|
-
format: {
|
|
16
|
-
type: String
|
|
17
|
-
},
|
|
18
|
-
options: {
|
|
19
|
-
type: Array
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
emits: ["update:modelValue"],
|
|
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);
|
|
28
|
-
}
|
|
29
|
-
function u() {
|
|
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
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
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(() => {
|
|
61
|
-
u();
|
|
62
|
-
}), (t, r) => p((_(), g("div", B, [
|
|
63
|
-
h("div", {
|
|
64
|
-
class: "codemirror-code",
|
|
65
|
-
ref_key: "refText",
|
|
66
|
-
ref: s
|
|
67
|
-
}, null, 512)
|
|
68
|
-
])), [
|
|
69
|
-
[V(w), {
|
|
70
|
-
bottom: {}
|
|
71
|
-
}]
|
|
72
|
-
]);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
export {
|
|
76
|
-
J as default
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./codemirror.vue.cjs");;/* empty css */module.exports=e;
|