vuesp-components 2.1.7 → 2.1.9
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/app-CG8zhRFf.js +59 -0
- package/dist/components/script/editor/ScriptEditor.vue.d.ts.map +1 -1
- package/dist/components/script/editor/format.d.ts +2 -2
- package/dist/components/script/editor/format.d.ts.map +1 -1
- package/dist/components/script/editor/highlighters/index.d.ts +2 -1
- package/dist/components/script/editor/highlighters/index.d.ts.map +1 -1
- package/dist/components/script/editor/plugins/autocomplete.d.ts.map +1 -1
- package/dist/components/script/editor/plugins/render/index.d.ts.map +1 -1
- package/dist/components/script/editor/plugins/types.d.ts +2 -2
- package/dist/components/script/editor/plugins/types.d.ts.map +1 -1
- package/dist/components/script/editor/suggestions.d.ts +3 -0
- package/dist/components/script/editor/suggestions.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.es.js +76 -54
- package/dist/index.es.js +1322 -1311
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/script/editor/plugins/suggestions.d.ts +0 -3
- package/dist/components/script/editor/plugins/suggestions.d.ts.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const c = (t) => {
|
|
2
|
+
try {
|
|
3
|
+
return t ? JSON.parse(t) : null;
|
|
4
|
+
} catch (e) {
|
|
5
|
+
return console.warn(e), t;
|
|
6
|
+
}
|
|
7
|
+
}, i = (t) => typeof t == "object" ? JSON.stringify(t) : t, h = (t) => c(i(t)), f = (t) => {
|
|
8
|
+
const e = ["B", "KB", "MB"];
|
|
9
|
+
if (t == 0) return "0 B";
|
|
10
|
+
let o = Math.floor(Math.log(t) / Math.log(1024));
|
|
11
|
+
return o > 1 && (o = 1), Math.round(t / Math.pow(1024, o)) + " " + e[o];
|
|
12
|
+
}, p = (t, e = { year: "numeric", month: "numeric", day: "numeric" }, o = []) => new Date(t).toLocaleDateString(o, e), S = (t, e = { minute: "2-digit", hour: "2-digit" }, o = []) => new Date(t).toLocaleTimeString(o, e), r = (t) => t >= 10 ? t : `0${t}`, w = (t) => {
|
|
13
|
+
const e = Math.floor(t % 31536e3 % 2628e3 / 86400), o = Math.floor(t % (3600 * 24) / 3600), n = Math.floor(t % 3600 / 60), u = Math.floor(t % 60);
|
|
14
|
+
return `${e ? e + " days " : ""} ${r(o)}:${r(n)}:${r(u)}`;
|
|
15
|
+
}, y = (t) => t.join("."), M = (t) => t.split(".").map((e) => +e), T = (t = 6) => [...Array(t)].map(() => "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[Math.random() * 62 | 0]).join(""), j = (t, e = "file") => {
|
|
16
|
+
const o = document.createElement("a");
|
|
17
|
+
o.setAttribute("download", e), o.href = t, document.body.appendChild(o), o.click(), o.remove();
|
|
18
|
+
}, E = (t) => new Promise((e, o) => {
|
|
19
|
+
const n = document.createElement("script");
|
|
20
|
+
n.src = t, n.type = "text/javascript", n.async = !0, n.onload = () => e(n), n.onerror = () => o(new Error(`Ошибка загрузки скрипта: ${t}`)), document.head.appendChild(n);
|
|
21
|
+
}), s = typeof window < "u", a = (t) => (e, o) => o ? c(t.getItem(e)) : t.getItem(e), l = (t) => (e, o) => {
|
|
22
|
+
t.setItem(e, typeof o == "string" ? o : i(o));
|
|
23
|
+
}, d = s ? a(localStorage) : () => null, m = s ? l(localStorage) : () => {
|
|
24
|
+
}, L = s ? a(sessionStorage) : () => null, k = s ? l(sessionStorage) : () => {
|
|
25
|
+
}, B = (t = "isShow") => {
|
|
26
|
+
const e = d(t);
|
|
27
|
+
return e || m(t, "true"), !e;
|
|
28
|
+
}, $ = (t) => {
|
|
29
|
+
m("theme", t), document.documentElement.classList.remove("dark"), document.documentElement.classList.remove("light"), document.documentElement.classList.add(t);
|
|
30
|
+
}, g = (t, e) => {
|
|
31
|
+
if (!t) return null;
|
|
32
|
+
for (const o of t)
|
|
33
|
+
if (!(e === "/" || o.path === "/") && (o.path === e || e.includes(o.path)))
|
|
34
|
+
return o;
|
|
35
|
+
return null;
|
|
36
|
+
}, b = (t, e) => g(t, e);
|
|
37
|
+
export {
|
|
38
|
+
r as a,
|
|
39
|
+
y as b,
|
|
40
|
+
$ as c,
|
|
41
|
+
h as d,
|
|
42
|
+
j as e,
|
|
43
|
+
p as f,
|
|
44
|
+
g,
|
|
45
|
+
b as h,
|
|
46
|
+
B as i,
|
|
47
|
+
c as j,
|
|
48
|
+
i as k,
|
|
49
|
+
E as l,
|
|
50
|
+
d as m,
|
|
51
|
+
m as n,
|
|
52
|
+
L as o,
|
|
53
|
+
k as p,
|
|
54
|
+
M as q,
|
|
55
|
+
T as r,
|
|
56
|
+
w as s,
|
|
57
|
+
S as t,
|
|
58
|
+
f as u
|
|
59
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/script/editor/ScriptEditor.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScriptEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/script/editor/ScriptEditor.vue"],"names":[],"mappings":"AAwGA,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,SAAS,CAAC;;;;;;;;AAsGrE,wBAQG"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare
|
|
1
|
+
export declare const normalizeScript: (code: string) => string;
|
|
2
|
+
export declare function formatScript(codeString: string): string;
|
|
3
3
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/components/script/editor/format.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/components/script/editor/format.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,WA6B3C,CAAC;AAOF,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAgEvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/highlighters/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/highlighters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAoB/C,eAAO,MAAM,eAAe,GAAI,aAAa,WAAW,EAAE,MAAM,OAAO,MAAM,WAwB5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/autocomplete.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/autocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,KAAK,EAAe,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgBjE,eAAO,MAAM,YAAY,GAAI,SAAS,oBAAoB,KAAG,MAyK5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/script/editor/plugins/render/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/script/editor/plugins/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAS5C,eAAO,MAAM,UAAU,GAAI,aAAa,WAAW,EAAE,EAAE,eAAe,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAG,WA+BjH,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,YAAY,WAAW,EAAE,UAAU;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,KAAG,WAiChG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAChC,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,WAAW,CAAC;IACzC,UAAU,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,WAAW,CAAC;IAClH,aAAa,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,WAAW,CAAC;CAClG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/script/editor/suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAO,MAAM,mBAAmB,EAAE,WAAW,EA2B5C,CAAC"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,mCAAmC,CAAC"}
|
package/dist/helpers/index.es.js
CHANGED
|
@@ -1,59 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { a as f, b as m, c as d, d as k, e as b, f as S, g, h as y, i as T, j as v, k as W, l as _, m as w, n as j, r as q, s as x, o as z, p as G, q as P, t as U, u as A } from "../app-CG8zhRFf.js";
|
|
2
|
+
const c = (o) => {
|
|
3
|
+
let s = "", n = !1, i = "";
|
|
4
|
+
for (let a = 0; a < o.length; a++) {
|
|
5
|
+
const t = o[a];
|
|
6
|
+
if ((t === '"' || t === "'") && (a === 0 || o[a - 1] !== "\\")) {
|
|
7
|
+
n ? (t === i && (n = !1), s += t) : (n = !0, i = t, s += t);
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
if (n) {
|
|
11
|
+
s += t;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
t === " " || t === " " || t === `
|
|
15
|
+
` || t === "\r" || (s += t);
|
|
6
16
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
return s;
|
|
18
|
+
};
|
|
19
|
+
function p(o) {
|
|
20
|
+
const s = [];
|
|
21
|
+
let n = "";
|
|
22
|
+
for (let e = 0; e < o.length; e++) {
|
|
23
|
+
const l = o[e];
|
|
24
|
+
if (l === ";") {
|
|
25
|
+
if (n.trim()) {
|
|
26
|
+
const r = n.trim();
|
|
27
|
+
r.startsWith("while:") || r.startsWith("if:") || r.startsWith("on(") ? s.push({ type: "block_start", value: r }) : r === "else" ? s.push({ type: "else", value: r }) : r === "end" ? s.push({ type: "block_end", value: r }) : s.push({ type: "command", value: r }), n = "";
|
|
28
|
+
}
|
|
29
|
+
} else
|
|
30
|
+
n += l;
|
|
31
|
+
}
|
|
32
|
+
if (n.trim()) {
|
|
33
|
+
const e = n.trim();
|
|
34
|
+
e.startsWith("while:") || e.startsWith("if:") || e.startsWith("on(") ? s.push({ type: "block_start", value: e }) : e === "else" ? s.push({ type: "else", value: e }) : e === "end" ? s.push({ type: "block_end", value: e }) : s.push({ type: "command", value: e });
|
|
35
|
+
}
|
|
36
|
+
const i = [];
|
|
37
|
+
let a = 0;
|
|
38
|
+
const t = 2;
|
|
39
|
+
for (const e of s)
|
|
40
|
+
switch (e.type) {
|
|
41
|
+
case "block_start":
|
|
42
|
+
i.push(" ".repeat(a * t) + e.value + ";"), a++;
|
|
43
|
+
break;
|
|
44
|
+
case "else":
|
|
45
|
+
a--, i.push(" ".repeat(a * t) + e.value + ";"), a++;
|
|
46
|
+
break;
|
|
47
|
+
case "block_end":
|
|
48
|
+
a--, i.push(" ".repeat(a * t) + e.value + ";");
|
|
49
|
+
break;
|
|
50
|
+
case "command":
|
|
51
|
+
i.push(" ".repeat(a * t) + e.value + ";");
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
return i.join(`
|
|
55
|
+
`);
|
|
56
|
+
}
|
|
37
57
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
f as addZero,
|
|
59
|
+
m as arrToStr,
|
|
60
|
+
d as changeTheme,
|
|
61
|
+
k as clone,
|
|
62
|
+
b as createDownloadLink,
|
|
43
63
|
S as dateUtcToString,
|
|
44
64
|
g as findMenuItem,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
p as formatScript,
|
|
66
|
+
y as getPageTitle,
|
|
67
|
+
T as isNewVersion,
|
|
68
|
+
v as jsonParse,
|
|
69
|
+
W as jsonString,
|
|
70
|
+
_ as loadScript,
|
|
71
|
+
w as localGet,
|
|
72
|
+
j as localSet,
|
|
73
|
+
c as normalizeScript,
|
|
74
|
+
q as randomString,
|
|
75
|
+
x as secToTime,
|
|
76
|
+
z as sessionGet,
|
|
77
|
+
G as sessionSet,
|
|
78
|
+
P as strToArr,
|
|
79
|
+
U as timeUtcToString,
|
|
80
|
+
A as toByte
|
|
59
81
|
};
|