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