vuesp-components 5.2.2 → 5.3.1
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/CHANGELOG.md +20 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.es.js +3252 -2469
- package/dist/components/serial/SerialConsole.vue.d.ts +46 -0
- package/dist/components/serial/SerialConsole.vue.d.ts.map +1 -0
- package/dist/components/serial/index.d.ts +5 -0
- package/dist/components/serial/index.d.ts.map +1 -0
- package/dist/components/serial/labels.d.ts +3 -0
- package/dist/components/serial/labels.d.ts.map +1 -0
- package/dist/components/serial/types.d.ts +137 -0
- package/dist/components/serial/types.d.ts.map +1 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/index.es.js +325 -94
- package/dist/composables/useSerialConsole.d.ts +78 -0
- package/dist/composables/useSerialConsole.d.ts.map +1 -0
- package/dist/pages/kit/KitShowcase.vue.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -3
|
@@ -1,118 +1,349 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { u as
|
|
3
|
-
function
|
|
4
|
-
const { validationSchema:
|
|
5
|
-
|
|
6
|
-
),
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
s in
|
|
1
|
+
import { ref as f, reactive as _, watch as z, computed as D, onMounted as Oe, onBeforeUnmount as De } from "vue";
|
|
2
|
+
import { u as He, b as Pe, a as Xe } from "../useDialog-Buvn63AR.js";
|
|
3
|
+
function Ke(c) {
|
|
4
|
+
const { validationSchema: i, initialValues: v = {} } = c, w = typeof i == "function", b = f(
|
|
5
|
+
w ? i(v) : i
|
|
6
|
+
), F = f(!0), I = (n) => {
|
|
7
|
+
b.value = n;
|
|
8
|
+
const r = Object.keys(n), o = Object.keys(l);
|
|
9
|
+
r.forEach((s) => {
|
|
10
|
+
s in l || (l[s] = v[s] ?? "", p[s] = [], x[s] = !1, g[s] = !1);
|
|
11
11
|
}), o.forEach((s) => {
|
|
12
|
-
|
|
13
|
-
}),
|
|
14
|
-
},
|
|
15
|
-
Object.keys(
|
|
16
|
-
|
|
17
|
-
}),
|
|
18
|
-
},
|
|
19
|
-
const s =
|
|
20
|
-
for (const
|
|
21
|
-
const
|
|
22
|
-
|
|
12
|
+
r.includes(s) || (delete l[s], delete p[s], delete x[s], delete g[s]);
|
|
13
|
+
}), Q(), L();
|
|
14
|
+
}, l = _({}), p = _({}), x = _({}), g = _({}), d = /* @__PURE__ */ new Map(), U = () => {
|
|
15
|
+
Object.keys(b.value).forEach((n) => {
|
|
16
|
+
l[n] = v[n] ?? "", p[n] = [], x[n] = !1, g[n] = !1;
|
|
17
|
+
}), F.value = !0;
|
|
18
|
+
}, E = () => w ? i(l) : b.value, C = (n, r) => {
|
|
19
|
+
const s = E()[n] || [], h = [];
|
|
20
|
+
for (const y of s) {
|
|
21
|
+
const T = y(r, l);
|
|
22
|
+
T !== !0 && h.push(T);
|
|
23
23
|
}
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
const o =
|
|
27
|
-
if (!o[
|
|
28
|
-
|
|
29
|
-
const s =
|
|
30
|
-
s && s.forEach((
|
|
31
|
-
o[
|
|
32
|
-
}),
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
Object.keys(
|
|
37
|
-
(
|
|
24
|
+
return p[n] = h, h.length === 0;
|
|
25
|
+
}, K = (n, r) => {
|
|
26
|
+
const o = E();
|
|
27
|
+
if (!o[n]) return;
|
|
28
|
+
C(n, r);
|
|
29
|
+
const s = d.get(n);
|
|
30
|
+
s && s.forEach((h) => {
|
|
31
|
+
o[h] && C(h, l[h]);
|
|
32
|
+
}), L();
|
|
33
|
+
}, Q = () => {
|
|
34
|
+
d.clear();
|
|
35
|
+
const n = E();
|
|
36
|
+
Object.keys(n).forEach((r) => {
|
|
37
|
+
(n[r] || []).forEach((s) => {
|
|
38
38
|
if (typeof s == "function" && s.name === "sameAs") {
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
|
|
39
|
+
const h = s.toString().match(/['"](.*?)['"]/);
|
|
40
|
+
if (h) {
|
|
41
|
+
const y = h[1];
|
|
42
|
+
d.has(y) || d.set(y, /* @__PURE__ */ new Set()), d.get(y).add(r);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
});
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
return Object.keys(
|
|
51
|
-
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
54
|
-
|
|
47
|
+
}, L = () => {
|
|
48
|
+
const n = E();
|
|
49
|
+
let r = !0;
|
|
50
|
+
return Object.keys(n).forEach((o) => {
|
|
51
|
+
C(o, l[o]) || (r = !1);
|
|
52
|
+
}), F.value = r, r;
|
|
53
|
+
}, M = (n, r = {}) => {
|
|
54
|
+
E()[n] || console.warn(`Field "${n}" not found in current validationSchema`);
|
|
55
55
|
const s = D({
|
|
56
|
-
get: () =>
|
|
57
|
-
set: (
|
|
58
|
-
|
|
56
|
+
get: () => l[n],
|
|
57
|
+
set: (y) => {
|
|
58
|
+
l[n] = y, g[n] = !0, K(n, y);
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
61
|
-
var
|
|
62
|
-
const
|
|
63
|
-
errors:
|
|
64
|
-
touched:
|
|
65
|
-
dirty:
|
|
66
|
-
},
|
|
67
|
-
message: (
|
|
68
|
-
onInput: (
|
|
69
|
-
const
|
|
70
|
-
s.value =
|
|
60
|
+
}), h = D(() => {
|
|
61
|
+
var A;
|
|
62
|
+
const y = {
|
|
63
|
+
errors: p[n] || [],
|
|
64
|
+
touched: x[n] || !1,
|
|
65
|
+
dirty: g[n] || !1
|
|
66
|
+
}, T = {
|
|
67
|
+
message: (A = p[n]) == null ? void 0 : A[0],
|
|
68
|
+
onInput: (O) => {
|
|
69
|
+
const $ = O.target;
|
|
70
|
+
s.value = $.value;
|
|
71
71
|
},
|
|
72
72
|
onBlur: () => {
|
|
73
|
-
|
|
73
|
+
x[n] = !0, K(n, l[n]);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
return { ...
|
|
76
|
+
if (r.props) {
|
|
77
|
+
const O = r.props(y);
|
|
78
|
+
return { ...T, ...O };
|
|
79
79
|
}
|
|
80
|
-
return
|
|
80
|
+
return T;
|
|
81
81
|
});
|
|
82
|
-
return [s,
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
const o =
|
|
86
|
-
Object.keys(o).forEach((
|
|
87
|
-
|
|
88
|
-
}),
|
|
89
|
-
},
|
|
90
|
-
const
|
|
91
|
-
Object.keys(
|
|
92
|
-
|
|
93
|
-
}),
|
|
82
|
+
return [s, h];
|
|
83
|
+
}, k = (n) => async (r) => {
|
|
84
|
+
r && r.preventDefault();
|
|
85
|
+
const o = E();
|
|
86
|
+
Object.keys(o).forEach((h) => {
|
|
87
|
+
x[h] = !0;
|
|
88
|
+
}), L() && await n(l);
|
|
89
|
+
}, j = () => {
|
|
90
|
+
const n = E();
|
|
91
|
+
Object.keys(n).forEach((r) => {
|
|
92
|
+
l[r] = v[r] || "", p[r] = [], x[r] = !1, g[r] = !1;
|
|
93
|
+
}), F.value = !0;
|
|
94
94
|
};
|
|
95
|
-
return
|
|
96
|
-
() =>
|
|
95
|
+
return U(), Q(), w && z(
|
|
96
|
+
() => l,
|
|
97
97
|
() => {
|
|
98
|
-
const
|
|
99
|
-
(o.length !== s.length || o.some((
|
|
98
|
+
const n = i(l), r = b.value, o = Object.keys(n), s = Object.keys(r);
|
|
99
|
+
(o.length !== s.length || o.some((h) => !s.includes(h))) && I(n);
|
|
100
100
|
},
|
|
101
101
|
{ deep: !0 }
|
|
102
102
|
), {
|
|
103
|
-
values:
|
|
104
|
-
errors:
|
|
105
|
-
defineField:
|
|
106
|
-
handleSubmit:
|
|
107
|
-
resetForm:
|
|
108
|
-
validate:
|
|
109
|
-
updateSchema:
|
|
110
|
-
isValid:
|
|
103
|
+
values: l,
|
|
104
|
+
errors: p,
|
|
105
|
+
defineField: M,
|
|
106
|
+
handleSubmit: k,
|
|
107
|
+
resetForm: j,
|
|
108
|
+
validate: L,
|
|
109
|
+
updateSchema: I,
|
|
110
|
+
isValid: F
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const Ie = 150, Me = 4096, ie = 256 * 1024, fe = 12, Ue = 1200, Ce = { utf8: "utf-8", cp1251: "windows-1251" }, je = {
|
|
114
|
+
encoding: "utf8",
|
|
115
|
+
framing: "line",
|
|
116
|
+
gapMs: 25,
|
|
117
|
+
paused: !1
|
|
118
|
+
}, $e = (c, i) => (
|
|
119
|
+
// eslint-disable-next-line no-control-regex
|
|
120
|
+
new TextDecoder(Ce[i]).decode(c).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g, ".")
|
|
121
|
+
), Be = (c) => Array.from(c, (i) => i.toString(16).padStart(2, "0")).join(" ");
|
|
122
|
+
function Qe(c) {
|
|
123
|
+
var oe, ue;
|
|
124
|
+
const i = f([]), v = _({ ...je }), w = f(0), b = f(0), F = f(0), I = f(0), l = f(""), p = f(!1), x = f(((oe = c.initialLineEnding) == null ? void 0 : oe.call(c)) ?? "crlf"), g = f([]), d = f(-1), U = f(""), E = f(!1), C = f(!0), K = f(!0), Q = f(!0), L = f(!1), M = f(!1), k = f([]), j = f("");
|
|
125
|
+
let n = 0, r = [], o = [], s = null, h = null, y = null, T = "", A = null, O = 0, $ = 0, V = 0, R = null;
|
|
126
|
+
const G = (e) => {
|
|
127
|
+
var a;
|
|
128
|
+
const t = (a = c.storageKey) == null ? void 0 : a.call(c);
|
|
129
|
+
return t ? `${t}:${e}` : null;
|
|
130
|
+
}, J = (e) => {
|
|
131
|
+
const t = G(e);
|
|
132
|
+
if (!t || typeof localStorage > "u") return null;
|
|
133
|
+
try {
|
|
134
|
+
const a = localStorage.getItem(t);
|
|
135
|
+
return a ? JSON.parse(a) : null;
|
|
136
|
+
} catch {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}, H = (e, t) => {
|
|
140
|
+
const a = G(e);
|
|
141
|
+
if (!(!a || typeof localStorage > "u"))
|
|
142
|
+
try {
|
|
143
|
+
localStorage.setItem(a, JSON.stringify(t));
|
|
144
|
+
} catch {
|
|
145
|
+
}
|
|
146
|
+
}, W = J("view");
|
|
147
|
+
W && Object.assign(v, W, { paused: !1 }), v.paused = !1;
|
|
148
|
+
const he = J("quick"), de = ((ue = c.initialQuickCommands) == null ? void 0 : ue.call(c)) ?? [];
|
|
149
|
+
k.value = (he ?? de).filter((e) => typeof e == "string").slice(0, fe), z(v, () => H("view", { ...v, paused: !1 }), { deep: !0 });
|
|
150
|
+
const P = (e, t) => {
|
|
151
|
+
const a = $e(t, v.encoding);
|
|
152
|
+
i.value.push({
|
|
153
|
+
id: ++n,
|
|
154
|
+
dir: e,
|
|
155
|
+
at: (/* @__PURE__ */ new Date()).toLocaleTimeString(c.locale() === "ru" ? "ru-RU" : "en-GB", { hour12: !1 }),
|
|
156
|
+
text: v.framing === "gap" ? a.replace(/[\r\n]+/g, " ") : a,
|
|
157
|
+
hex: Be(t),
|
|
158
|
+
bytes: t.length
|
|
159
|
+
});
|
|
160
|
+
const u = c.maxLines();
|
|
161
|
+
i.value.length > u && i.value.splice(0, i.value.length - u);
|
|
162
|
+
}, q = () => {
|
|
163
|
+
s && (clearTimeout(s), s = null);
|
|
164
|
+
}, Y = () => {
|
|
165
|
+
if (q(), !r.length) return;
|
|
166
|
+
const e = new Uint8Array(r);
|
|
167
|
+
r = [], P("rx", e);
|
|
168
|
+
}, ve = () => {
|
|
169
|
+
q();
|
|
170
|
+
const e = v.framing === "gap" ? Math.max(5, v.gapMs) : Ie;
|
|
171
|
+
s = setTimeout(Y, e);
|
|
172
|
+
}, Z = (e) => {
|
|
173
|
+
for (const t of e) r.push(t);
|
|
174
|
+
if (v.framing === "line") {
|
|
175
|
+
let t = 0;
|
|
176
|
+
for (let a = 0; a < r.length; a++) {
|
|
177
|
+
const u = r[a];
|
|
178
|
+
if (u !== 10 && u !== 13) continue;
|
|
179
|
+
const m = r.slice(t, a);
|
|
180
|
+
m.length && P("rx", new Uint8Array(m)), u === 13 && r[a + 1] === 10 && a++, t = a + 1;
|
|
181
|
+
}
|
|
182
|
+
t && (r = r.slice(t));
|
|
183
|
+
}
|
|
184
|
+
r.length >= Me ? Y() : ve();
|
|
185
|
+
}, B = () => {
|
|
186
|
+
y && clearTimeout(y), y = null, M.value = !1;
|
|
187
|
+
}, ge = (e) => {
|
|
188
|
+
var a;
|
|
189
|
+
const t = (a = c.noReplyHint) == null ? void 0 : a.call(c);
|
|
190
|
+
t && (B(), y = setTimeout(() => {
|
|
191
|
+
w.value === e && (M.value = !0);
|
|
192
|
+
}, t.delay ?? 1500));
|
|
193
|
+
}, ye = (e) => {
|
|
194
|
+
if (e != null && e.length) {
|
|
195
|
+
if (M.value && B(), w.value += e.length, v.paused) {
|
|
196
|
+
for (const t of e) o.push(t);
|
|
197
|
+
o.length > ie && o.splice(0, o.length - ie);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
Z(e);
|
|
201
|
+
}
|
|
202
|
+
}, me = () => {
|
|
203
|
+
R == null || R(), R = c.transport().subscribe(ye);
|
|
204
|
+
};
|
|
205
|
+
z(
|
|
206
|
+
() => v.paused,
|
|
207
|
+
(e) => {
|
|
208
|
+
if (e || !o.length) return;
|
|
209
|
+
const t = new Uint8Array(o);
|
|
210
|
+
o = [], Z(t);
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
const N = async (e) => {
|
|
214
|
+
const t = await c.transport().send(e);
|
|
215
|
+
return t && (b.value += e.length, P("tx", e)), t;
|
|
216
|
+
}, X = D(() => l.value.replace(/^0x/i, "").replace(/0x/gi, "").replace(/[^0-9a-fA-F]/g, "")), pe = D(() => {
|
|
217
|
+
const e = l.value.replace(/0x/gi, "").replace(/[\s,;:]/g, "");
|
|
218
|
+
return e.length > 0 && /[^0-9a-fA-F]/.test(e);
|
|
219
|
+
}), ee = D(() => {
|
|
220
|
+
const e = X.value, t = [];
|
|
221
|
+
for (let a = 0; a + 1 < e.length; a += 2) t.push(parseInt(e.slice(a, a + 2), 16));
|
|
222
|
+
return t;
|
|
223
|
+
}), te = D(() => p.value ? pe.value ? c.labels().hexInvalid : X.value && X.value.length % 2 ? c.labels().hexOdd : "" : ""), ne = (e, t) => {
|
|
224
|
+
if (t) {
|
|
225
|
+
const u = e.replace(/0x/gi, "").replace(/[^0-9a-fA-F]/g, "");
|
|
226
|
+
if (!u.length || u.length % 2) return [];
|
|
227
|
+
const m = [];
|
|
228
|
+
for (let S = 0; S + 1 < u.length; S += 2) m.push(parseInt(u.slice(S, S + 2), 16));
|
|
229
|
+
return m;
|
|
230
|
+
}
|
|
231
|
+
const a = Array.from(new TextEncoder().encode(e));
|
|
232
|
+
return (x.value === "cr" || x.value === "crlf") && a.push(13), (x.value === "lf" || x.value === "crlf") && a.push(10), a;
|
|
233
|
+
}, xe = async () => {
|
|
234
|
+
if (p.value && (te.value || !ee.value.length)) return;
|
|
235
|
+
const e = l.value, t = ne(e, p.value);
|
|
236
|
+
!t.length || !await N(new Uint8Array(t.slice(0, 4096))) || (e.trim() && (g.value = [e, ...g.value.filter((u) => u !== e)].slice(0, 50), d.value = -1), l.value = "");
|
|
237
|
+
}, re = async (e) => {
|
|
238
|
+
const t = ne(e, !1);
|
|
239
|
+
if (!t.length) return;
|
|
240
|
+
const a = w.value;
|
|
241
|
+
await N(new Uint8Array(t.slice(0, 4096))) && (g.value = [e, ...g.value.filter((m) => m !== e)].slice(0, 50), d.value = -1, T = e, ge(a));
|
|
242
|
+
}, we = async () => {
|
|
243
|
+
var t;
|
|
244
|
+
const e = (t = c.noReplyHint) == null ? void 0 : t.call(c);
|
|
245
|
+
e != null && e.onAction && (B(), await e.onAction(), (e.resend ?? !0) && T && await re(T));
|
|
246
|
+
}, ke = (e) => {
|
|
247
|
+
if (e.key === "ArrowUp") {
|
|
248
|
+
if (!g.value.length) return;
|
|
249
|
+
e.preventDefault(), d.value = d.value === -1 ? g.value.length - 1 : Math.max(0, d.value - 1), l.value = g.value[d.value] ?? "";
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (e.key === "ArrowDown") {
|
|
253
|
+
if (d.value === -1) return;
|
|
254
|
+
e.preventDefault(), d.value++, d.value >= g.value.length ? (d.value = -1, l.value = "") : l.value = g.value[d.value] ?? "";
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
e.key === "Escape" && (l.value = "", d.value = -1);
|
|
258
|
+
}, Se = D(() => {
|
|
259
|
+
const e = U.value.trim().toLowerCase();
|
|
260
|
+
return e ? i.value.filter((t) => t.text.toLowerCase().includes(e) || t.hex.toLowerCase().includes(e)) : i.value;
|
|
261
|
+
}), be = (e) => E.value ? e.hex : e.text || e.hex, Ee = (e) => {
|
|
262
|
+
const t = U.value.trim().toLowerCase();
|
|
263
|
+
if (!t) return [{ text: e, match: !1 }];
|
|
264
|
+
const a = e.toLowerCase(), u = [];
|
|
265
|
+
let m = 0;
|
|
266
|
+
for (; m < e.length; ) {
|
|
267
|
+
const S = a.indexOf(t, m);
|
|
268
|
+
if (S === -1) break;
|
|
269
|
+
S > m && u.push({ text: e.slice(m, S), match: !1 }), u.push({ text: e.slice(S, S + t.length), match: !0 }), m = S + t.length;
|
|
270
|
+
}
|
|
271
|
+
return m < e.length && u.push({ text: e.slice(m), match: !1 }), u.length ? u : [{ text: e, match: !1 }];
|
|
272
|
+
}, ae = () => i.value.map((e) => `${e.at} ${e.dir.toUpperCase()} ${e.text || e.hex}`).join(`
|
|
273
|
+
`), se = async () => {
|
|
274
|
+
if (!i.value.length) return !1;
|
|
275
|
+
try {
|
|
276
|
+
return await navigator.clipboard.writeText(ae()), L.value = !0, A && clearTimeout(A), A = setTimeout(() => {
|
|
277
|
+
L.value = !1;
|
|
278
|
+
}, Ue), !0;
|
|
279
|
+
} catch {
|
|
280
|
+
return !1;
|
|
281
|
+
}
|
|
282
|
+
}, Te = () => {
|
|
283
|
+
if (!i.value.length) return !1;
|
|
284
|
+
const e = new Blob([ae()], { type: "text/plain;charset=utf-8" }), t = URL.createObjectURL(e), a = document.createElement("a"), u = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
285
|
+
return a.href = t, a.download = `serial-${u}.log`, a.click(), URL.revokeObjectURL(t), !0;
|
|
286
|
+
}, ce = () => {
|
|
287
|
+
B(), q(), r = [], o = [], i.value = [], w.value = 0, b.value = 0, F.value = 0, I.value = 0, O = 0, $ = 0, V = performance.now();
|
|
288
|
+
}, Fe = (e) => {
|
|
289
|
+
const t = c.labels();
|
|
290
|
+
return e < 1024 ? `${e} ${t.byteShort}` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} ${t.kiloShort}` : `${(e / (1024 * 1024)).toFixed(2)} ${t.megaShort}`;
|
|
291
|
+
}, Le = () => {
|
|
292
|
+
const e = performance.now(), t = (e - V) / 1e3;
|
|
293
|
+
t <= 0 || (F.value = Math.max(0, Math.round((w.value - O) / t)), I.value = Math.max(0, Math.round((b.value - $) / t)), O = w.value, $ = b.value, V = e);
|
|
294
|
+
}, Ae = () => {
|
|
295
|
+
const e = j.value.trim();
|
|
296
|
+
e && (k.value.includes(e) || (k.value = [...k.value, e].slice(0, fe)), j.value = "", H("quick", k.value));
|
|
297
|
+
}, Re = (e) => {
|
|
298
|
+
k.value = k.value.filter((t) => t !== e), H("quick", k.value);
|
|
299
|
+
}, le = (e) => {
|
|
300
|
+
e.ctrlKey && (e.key.toLowerCase() === "l" && (e.preventDefault(), ce()), e.shiftKey && e.key.toLowerCase() === "c" && (e.preventDefault(), se()));
|
|
301
|
+
};
|
|
302
|
+
return Oe(() => {
|
|
303
|
+
me(), V = performance.now(), h = setInterval(Le, 1e3), window.addEventListener("keydown", le);
|
|
304
|
+
}), De(() => {
|
|
305
|
+
R == null || R(), R = null, B(), q(), h && clearInterval(h), A && clearTimeout(A), window.removeEventListener("keydown", le);
|
|
306
|
+
}), {
|
|
307
|
+
lines: i,
|
|
308
|
+
visibleLines: Se,
|
|
309
|
+
view: v,
|
|
310
|
+
rxBytes: w,
|
|
311
|
+
txBytes: b,
|
|
312
|
+
rxRate: F,
|
|
313
|
+
txRate: I,
|
|
314
|
+
input: l,
|
|
315
|
+
hexSend: p,
|
|
316
|
+
lineEnding: x,
|
|
317
|
+
history: g,
|
|
318
|
+
filter: U,
|
|
319
|
+
hexMode: E,
|
|
320
|
+
showTime: C,
|
|
321
|
+
wrapLines: K,
|
|
322
|
+
autoScroll: Q,
|
|
323
|
+
copied: L,
|
|
324
|
+
showNoReply: M,
|
|
325
|
+
quickCommands: k,
|
|
326
|
+
quickInput: j,
|
|
327
|
+
hexBytes: ee,
|
|
328
|
+
hexError: te,
|
|
329
|
+
sendText: xe,
|
|
330
|
+
sendQuick: re,
|
|
331
|
+
onInputKeydown: ke,
|
|
332
|
+
lineContent: be,
|
|
333
|
+
lineSegments: Ee,
|
|
334
|
+
copyLog: se,
|
|
335
|
+
downloadLog: Te,
|
|
336
|
+
clearLog: ce,
|
|
337
|
+
formatBytes: Fe,
|
|
338
|
+
addQuick: Ae,
|
|
339
|
+
removeQuick: Re,
|
|
340
|
+
applyHintAction: we
|
|
111
341
|
};
|
|
112
342
|
}
|
|
113
343
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
344
|
+
He as useDialog,
|
|
345
|
+
Pe as useFocusTrap,
|
|
346
|
+
Ke as useForm,
|
|
347
|
+
Qe as useSerialConsole,
|
|
348
|
+
Xe as useSwipeDown
|
|
118
349
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ISerialConsoleLabels, ISerialConsoleNoReplyHint, ISerialConsoleLine, ISerialConsoleTransport, TSerialConsoleDirection, TSerialConsoleEncoding, TSerialConsoleLineEnding, TSerialConsoleLocale } from '../components/serial/types';
|
|
2
|
+
export interface ISerialConsoleSegment {
|
|
3
|
+
text: string;
|
|
4
|
+
match: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface IUseSerialConsoleOptions {
|
|
7
|
+
transport: () => ISerialConsoleTransport;
|
|
8
|
+
locale: () => TSerialConsoleLocale;
|
|
9
|
+
labels: () => ISerialConsoleLabels;
|
|
10
|
+
maxLines: () => number;
|
|
11
|
+
storageKey?: () => string | undefined;
|
|
12
|
+
initialQuickCommands?: () => string[];
|
|
13
|
+
initialLineEnding?: () => TSerialConsoleLineEnding | undefined;
|
|
14
|
+
noReplyHint?: () => ISerialConsoleNoReplyHint | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare function useSerialConsole(options: IUseSerialConsoleOptions): {
|
|
17
|
+
lines: import('vue').Ref<{
|
|
18
|
+
id: number;
|
|
19
|
+
dir: TSerialConsoleDirection;
|
|
20
|
+
at: string;
|
|
21
|
+
text: string;
|
|
22
|
+
hex: string;
|
|
23
|
+
bytes: number;
|
|
24
|
+
}[], ISerialConsoleLine[] | {
|
|
25
|
+
id: number;
|
|
26
|
+
dir: TSerialConsoleDirection;
|
|
27
|
+
at: string;
|
|
28
|
+
text: string;
|
|
29
|
+
hex: string;
|
|
30
|
+
bytes: number;
|
|
31
|
+
}[]>;
|
|
32
|
+
visibleLines: import('vue').ComputedRef<{
|
|
33
|
+
id: number;
|
|
34
|
+
dir: TSerialConsoleDirection;
|
|
35
|
+
at: string;
|
|
36
|
+
text: string;
|
|
37
|
+
hex: string;
|
|
38
|
+
bytes: number;
|
|
39
|
+
}[]>;
|
|
40
|
+
view: {
|
|
41
|
+
encoding: TSerialConsoleEncoding;
|
|
42
|
+
framing: import('../components/serial/types').TSerialConsoleFraming;
|
|
43
|
+
gapMs: number;
|
|
44
|
+
paused: boolean;
|
|
45
|
+
};
|
|
46
|
+
rxBytes: import('vue').Ref<number, number>;
|
|
47
|
+
txBytes: import('vue').Ref<number, number>;
|
|
48
|
+
rxRate: import('vue').Ref<number, number>;
|
|
49
|
+
txRate: import('vue').Ref<number, number>;
|
|
50
|
+
input: import('vue').Ref<string, string>;
|
|
51
|
+
hexSend: import('vue').Ref<boolean, boolean>;
|
|
52
|
+
lineEnding: import('vue').Ref<TSerialConsoleLineEnding, TSerialConsoleLineEnding>;
|
|
53
|
+
history: import('vue').Ref<string[], string[]>;
|
|
54
|
+
filter: import('vue').Ref<string, string>;
|
|
55
|
+
hexMode: import('vue').Ref<boolean, boolean>;
|
|
56
|
+
showTime: import('vue').Ref<boolean, boolean>;
|
|
57
|
+
wrapLines: import('vue').Ref<boolean, boolean>;
|
|
58
|
+
autoScroll: import('vue').Ref<boolean, boolean>;
|
|
59
|
+
copied: import('vue').Ref<boolean, boolean>;
|
|
60
|
+
showNoReply: import('vue').Ref<boolean, boolean>;
|
|
61
|
+
quickCommands: import('vue').Ref<string[], string[]>;
|
|
62
|
+
quickInput: import('vue').Ref<string, string>;
|
|
63
|
+
hexBytes: import('vue').ComputedRef<number[]>;
|
|
64
|
+
hexError: import('vue').ComputedRef<string>;
|
|
65
|
+
sendText: () => Promise<void>;
|
|
66
|
+
sendQuick: (command: string) => Promise<void>;
|
|
67
|
+
onInputKeydown: (event: KeyboardEvent) => void;
|
|
68
|
+
lineContent: (line: ISerialConsoleLine) => string;
|
|
69
|
+
lineSegments: (value: string) => ISerialConsoleSegment[];
|
|
70
|
+
copyLog: () => Promise<boolean>;
|
|
71
|
+
downloadLog: () => boolean;
|
|
72
|
+
clearLog: () => void;
|
|
73
|
+
formatBytes: (value: number) => string;
|
|
74
|
+
addQuick: () => void;
|
|
75
|
+
removeQuick: (command: string) => void;
|
|
76
|
+
applyHintAction: () => Promise<void>;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=useSerialConsole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSerialConsole.d.ts","sourceRoot":"","sources":["../../src/composables/useSerialConsole.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EAEvB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAuBnC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,uBAAuB,CAAC;IACzC,MAAM,EAAE,MAAM,oBAAoB,CAAC;IACnC,MAAM,EAAE,MAAM,oBAAoB,CAAC;IACnC,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,wBAAwB,GAAG,SAAS,CAAC;IAC/D,WAAW,CAAC,EAAE,MAAM,yBAAyB,GAAG,SAAS,CAAC;CAC3D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA2NrC,OAAO,CAAC,IAAI,CAAC;yBAiBN,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;4BAoBzB,aAAa,KAAG,IAAI;wBAkCxB,kBAAkB,KAAG,MAAM;0BAEzB,MAAM,KAAG,qBAAqB,EAAE;mBAmBnC,OAAO,CAAC,OAAO,CAAC;uBAelB,OAAO;oBAaV,IAAI;yBAeG,MAAM,KAAG,MAAM;oBAkBtB,IAAI;2BAQK,MAAM,KAAG,IAAI;2BApIT,OAAO,CAAC,IAAI,CAAC;EA0MhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KitShowcase.vue.d.ts","sourceRoot":"","sources":["../../../src/pages/kit/KitShowcase.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"KitShowcase.vue.d.ts","sourceRoot":"","sources":["../../../src/pages/kit/KitShowcase.vue"],"names":[],"mappings":";AAyrGA,wBAMG"}
|