@fangzhongya/vue-archive 0.0.74 → 0.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/components/use/code.d.ts +17 -25
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.d.ts +41 -0
- package/dist/packages/components/use/retrie/input/editor/editor.d.ts +0 -51
- package/dist/packages/components/use/retrie/input/editor/editor.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/input/editor/editor.vue.js +7 -9
- package/package.json +1 -1
- package/dist/packages/components/use/retrie/input/editor/init.cjs +0 -1
- package/dist/packages/components/use/retrie/input/editor/init.js +0 -19
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default(): string;
|
|
19
|
-
};
|
|
20
|
-
}>> & Readonly<{
|
|
21
|
-
onRefresh?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
}>, {
|
|
23
|
-
html: string;
|
|
24
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
25
|
-
export default _default;
|
|
1
|
+
import { ObjStr, ObjUnk } from '../../config';
|
|
2
|
+
import { SpecObjs, Spec } from '../../utils/index';
|
|
3
|
+
export declare function getHmtl(propsname: string, param: {
|
|
4
|
+
[key: string]: SpecObjs[];
|
|
5
|
+
}, value: ObjUnk, slotValue?: ObjStr, propsText?: ObjStr, exposeText?: ObjUnk): Promise<string>;
|
|
6
|
+
export declare function setValStringify(v: unknown, key: string, propsText?: ObjStr): string | Promise<string>;
|
|
7
|
+
type SelectsObj = {
|
|
8
|
+
label: string;
|
|
9
|
+
prop: unknown;
|
|
10
|
+
};
|
|
11
|
+
export declare function getSpecType(val: Spec): {
|
|
12
|
+
arr: SelectsObj[];
|
|
13
|
+
type: string;
|
|
14
|
+
dataType: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare function getDefaultValue(obj: Spec, is?: boolean): any;
|
|
17
|
+
export {};
|
|
@@ -16,3 +16,44 @@ 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;
|
|
@@ -3,54 +3,3 @@ export declare function getJs(parent: HTMLElement, value: string): monaco.editor
|
|
|
3
3
|
export declare function getHtml(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
4
4
|
export declare function getJson(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
5
5
|
export declare function getCss(parent: HTMLElement, value: string): monaco.editor.IStandaloneCodeEditor;
|
|
6
|
-
]): string[];
|
|
7
|
-
new (arrayLength: number): string[];
|
|
8
|
-
new (...items: string[]): string[];
|
|
9
|
-
isArray(arg: any): arg is any[];
|
|
10
|
-
readonly prototype: any[];
|
|
11
|
-
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
12
|
-
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
13
|
-
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
14
|
-
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
15
|
-
of<T>(...items: T[]): T[];
|
|
16
|
-
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
17
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
18
|
-
readonly [Symbol.species]: ArrayConstructor;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
22
|
-
"update:modelValue": (...args: any[]) => void;
|
|
23
|
-
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
24
|
-
modelValue: {
|
|
25
|
-
type: StringConstructor;
|
|
26
|
-
default: string;
|
|
27
|
-
};
|
|
28
|
-
format: {
|
|
29
|
-
type: StringConstructor;
|
|
30
|
-
};
|
|
31
|
-
options: {
|
|
32
|
-
type: {
|
|
33
|
-
(arrayLength: number): string[];
|
|
34
|
-
(...items: string[]): string[];
|
|
35
|
-
new (arrayLength: number): string[];
|
|
36
|
-
new (...items: string[]): string[];
|
|
37
|
-
isArray(arg: any): arg is any[];
|
|
38
|
-
readonly prototype: any[];
|
|
39
|
-
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
40
|
-
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
41
|
-
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
42
|
-
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
43
|
-
of<T>(...items: T[]): T[];
|
|
44
|
-
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
45
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
46
|
-
readonly [Symbol.species]: ArrayConstructor;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
}>> & Readonly<{
|
|
50
|
-
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
51
|
-
}>, {
|
|
52
|
-
modelValue: string;
|
|
53
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
54
|
-
refText: HTMLDivElement;
|
|
55
|
-
}, HTMLDivElement>;
|
|
56
|
-
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),
|
|
1
|
+
"use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),r=require("./editor.cjs"),d={class:"editor-div"},v=t.defineComponent({__name:"editor",props:{modelValue:{type:String,default:`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
`},format:{type:String},options:{type:Array}},emits:["update:modelValue"],setup(
|
|
5
|
+
`},format:{type:String},options:{type:Array}},emits:["update:modelValue"],setup(u,{emit:n}){const e=u,i=n,s=t.ref(),l=t.shallowRef();function c(){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",d,[t.createElementVNode("div",{class:"editor-code",ref_key:"refText",ref:s},null,512)])),[[t.unref(m),{bottom:{}}]])}});module.exports=v;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
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
2
|
import x from "../../../../../directives/adjust/index.js";
|
|
3
3
|
import { getJs as y, getCss as B, getHtml as j, getJson as k } from "./editor.js";
|
|
4
|
-
|
|
5
|
-
const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
|
|
4
|
+
const w = { class: "editor-div" }, C = /* @__PURE__ */ m({
|
|
6
5
|
__name: "editor",
|
|
7
6
|
props: {
|
|
8
7
|
modelValue: {
|
|
@@ -23,12 +22,11 @@ const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
|
|
|
23
22
|
emits: ["update:modelValue"],
|
|
24
23
|
setup(r, { emit: s }) {
|
|
25
24
|
const e = r, u = s, l = f(), o = c();
|
|
26
|
-
function
|
|
27
|
-
w();
|
|
25
|
+
function n() {
|
|
28
26
|
const t = e.modelValue;
|
|
29
27
|
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));
|
|
30
28
|
}
|
|
31
|
-
function
|
|
29
|
+
function i(t) {
|
|
32
30
|
t && u("update:modelValue", t);
|
|
33
31
|
}
|
|
34
32
|
return d(
|
|
@@ -37,13 +35,13 @@ const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
|
|
|
37
35
|
o.value?.setValue(e.modelValue);
|
|
38
36
|
}
|
|
39
37
|
), v(() => {
|
|
40
|
-
|
|
38
|
+
n(), o.value?.onDidBlurEditorText((t) => {
|
|
41
39
|
if (o.value) {
|
|
42
40
|
const a = o.value.getValue();
|
|
43
|
-
|
|
41
|
+
i(a);
|
|
44
42
|
}
|
|
45
43
|
});
|
|
46
|
-
}), (t, a) => p((_(), V("div",
|
|
44
|
+
}), (t, a) => p((_(), V("div", w, [
|
|
47
45
|
g("div", {
|
|
48
46
|
class: "editor-code",
|
|
49
47
|
ref_key: "refText",
|
|
@@ -57,5 +55,5 @@ const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
|
|
|
57
55
|
}
|
|
58
56
|
});
|
|
59
57
|
export {
|
|
60
|
-
|
|
58
|
+
C as default
|
|
61
59
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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="/node_modules/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,19 +0,0 @@
|
|
|
1
|
-
import { languages as s } from "monaco-editor/esm/vs/editor/editor.main";
|
|
2
|
-
function e(t) {
|
|
3
|
-
const r = "/node_modules/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() {
|
|
11
|
-
self.MonacoEnvironment = {
|
|
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;
|
|
14
|
-
}
|
|
15
|
-
}, s.typescript.typescriptDefaults.setEagerModelSync(!0);
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
p as init
|
|
19
|
-
};
|