vuesp-components 2.1.7 → 2.1.8

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.
@@ -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":"AA2KA,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,SAAS,CAAC;;;;;;;;AA2HrE,wBAQG"}
1
+ {"version":3,"file":"ScriptEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/script/editor/ScriptEditor.vue"],"names":[],"mappings":"AAqGA,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,SAAS,CAAC;;;;;;;;AAmGrE,wBAQG"}
@@ -1,3 +1,3 @@
1
- export declare const removeLBScript: (code: string) => string;
2
- export declare const formatScript: (s: string) => string;
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,cAAc,GAAI,MAAM,MAAM,WA6B1C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,WAKrC,CAAC"}
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":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/autocomplete.ts"],"names":[],"mappings":"AACA,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
+ {"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":"AACA,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
+ {"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":"suggestions.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/suggestions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,mBAAmB,EAAE,WAAW,EAsB5C,CAAC"}
1
+ {"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../../../src/components/script/editor/plugins/suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,mBAAmB,EAAE,WAAW,EAwB5C,CAAC"}
@@ -1,8 +1,8 @@
1
1
  export interface ISuggestion {
2
2
  label: string;
3
- type: 'keyword' | 'function' | 'variable' | 'event';
3
+ type: 'word' | 'func' | 'var' | 'event';
4
4
  description?: string;
5
- insertText?: string;
5
+ insert?: string;
6
6
  detail?: string;
7
7
  cursorOffset?: number;
8
8
  }
@@ -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,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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"}
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"}
@@ -1,4 +1,5 @@
1
1
  export * from './app';
2
2
  export * from './general';
3
3
  export * from './web-api';
4
+ export * from '../components/script/editor/format';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -1,59 +1,81 @@
1
- const c = (t) => {
2
- try {
3
- return t ? JSON.parse(t) : null;
4
- } catch (e) {
5
- return console.warn(e), t;
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
- }, 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
- }, S = (t, e = { year: "numeric", month: "numeric", day: "numeric" }, o = []) => new Date(t).toLocaleDateString(o, e), p = (t, e = { minute: "2-digit", hour: "2-digit" }, o = []) => new Date(t).toLocaleTimeString(o, e), s = (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 " : ""} ${s(o)}:${s(n)}:${s(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
- }), r = typeof window < "u", l = (t) => (e, o) => o ? c(t.getItem(e)) : t.getItem(e), a = (t) => (e, o) => {
22
- t.setItem(e, typeof o == "string" ? o : i(o));
23
- }, d = r ? l(localStorage) : () => null, m = r ? a(localStorage) : () => {
24
- }, L = r ? l(sessionStorage) : () => null, B = r ? a(sessionStorage) : () => {
25
- }, $ = (t = "isShow") => {
26
- const e = d(t);
27
- return e || m(t, "true"), !e;
28
- }, k = (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
- }, D = (t, e) => g(t, e);
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
- s as addZero,
39
- y as arrToStr,
40
- k as changeTheme,
41
- h as clone,
42
- j as createDownloadLink,
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
- D as getPageTitle,
46
- $ as isNewVersion,
47
- c as jsonParse,
48
- i as jsonString,
49
- E as loadScript,
50
- d as localGet,
51
- m as localSet,
52
- T as randomString,
53
- w as secToTime,
54
- L as sessionGet,
55
- B as sessionSet,
56
- M as strToArr,
57
- p as timeUtcToString,
58
- f as toByte
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
  };