clay-server 2.36.2-beta.2 → 2.36.2-beta.3
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/lib/public/modules/app-misc.js +37 -26
- package/package.json +1 -1
|
@@ -296,12 +296,12 @@ export function showForceChangePinOverlay() {
|
|
|
296
296
|
'<h2 style="margin:0 0 8px;color:var(--text,#fff);font-size:22px">Set your new PIN</h2>' +
|
|
297
297
|
'<p style="margin:0 0 24px;color:var(--text-secondary,#aaa);font-size:14px">Your temporary PIN has expired. Please set a new 6-digit PIN to continue.</p>' +
|
|
298
298
|
'<div style="display:flex;gap:8px;justify-content:center;margin-bottom:16px" id="fcp-boxes">' +
|
|
299
|
-
'<input class="fcp-digit" type="
|
|
300
|
-
'<input class="fcp-digit" type="
|
|
301
|
-
'<input class="fcp-digit" type="
|
|
302
|
-
'<input class="fcp-digit" type="
|
|
303
|
-
'<input class="fcp-digit" type="
|
|
304
|
-
'<input class="fcp-digit" type="
|
|
299
|
+
'<input class="fcp-digit" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" style="width:44px;height:52px;text-align:center;font-size:22px;font-weight:600;border:2px solid var(--border,#333);border-radius:10px;background:var(--bg-alt,#f5f5f5);color:var(--text,#fff);outline:none;caret-color:var(--accent,#7c3aed)">' +
|
|
300
|
+
'<input class="fcp-digit" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" style="width:44px;height:52px;text-align:center;font-size:22px;font-weight:600;border:2px solid var(--border,#333);border-radius:10px;background:var(--bg-alt,#f5f5f5);color:var(--text,#fff);outline:none;caret-color:var(--accent,#7c3aed)">' +
|
|
301
|
+
'<input class="fcp-digit" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" style="width:44px;height:52px;text-align:center;font-size:22px;font-weight:600;border:2px solid var(--border,#333);border-radius:10px;background:var(--bg-alt,#f5f5f5);color:var(--text,#fff);outline:none;caret-color:var(--accent,#7c3aed)">' +
|
|
302
|
+
'<input class="fcp-digit" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" style="width:44px;height:52px;text-align:center;font-size:22px;font-weight:600;border:2px solid var(--border,#333);border-radius:10px;background:var(--bg-alt,#f5f5f5);color:var(--text,#fff);outline:none;caret-color:var(--accent,#7c3aed)">' +
|
|
303
|
+
'<input class="fcp-digit" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" style="width:44px;height:52px;text-align:center;font-size:22px;font-weight:600;border:2px solid var(--border,#333);border-radius:10px;background:var(--bg-alt,#f5f5f5);color:var(--text,#fff);outline:none;caret-color:var(--accent,#7c3aed)">' +
|
|
304
|
+
'<input class="fcp-digit" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" style="width:44px;height:52px;text-align:center;font-size:22px;font-weight:600;border:2px solid var(--border,#333);border-radius:10px;background:var(--bg-alt,#f5f5f5);color:var(--text,#fff);outline:none;caret-color:var(--accent,#7c3aed)">' +
|
|
305
305
|
'</div>' +
|
|
306
306
|
'<button id="fcp-save" disabled style="width:100%;padding:12px;border:none;border-radius:10px;background:var(--accent,#7c3aed);color:#fff;font-size:15px;font-weight:600;cursor:pointer;opacity:0.5">Save PIN</button>' +
|
|
307
307
|
'<div id="fcp-err" style="margin-top:12px;color:#ef4444;font-size:13px"></div>' +
|
|
@@ -311,45 +311,55 @@ export function showForceChangePinOverlay() {
|
|
|
311
311
|
var boxes = ov.querySelectorAll(".fcp-digit");
|
|
312
312
|
var saveBtn = ov.querySelector("#fcp-save");
|
|
313
313
|
var errEl = ov.querySelector("#fcp-err");
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
314
|
+
|
|
315
|
+
// Inject focus styling. Without this the inputs use outline:none with no
|
|
316
|
+
// replacement, so users cannot tell which box is focused. Caret is also
|
|
317
|
+
// forced via caret-color on the input style.
|
|
318
|
+
if (!document.getElementById("fcp-style")) {
|
|
319
|
+
var st = document.createElement("style");
|
|
320
|
+
st.id = "fcp-style";
|
|
321
|
+
st.textContent =
|
|
322
|
+
".fcp-digit:focus{border-color:var(--accent,#7c3aed)!important;box-shadow:0 0 0 3px rgba(124,58,237,0.25)}" +
|
|
323
|
+
".fcp-digit.filled{border-color:var(--accent,#7c3aed)}";
|
|
324
|
+
document.head.appendChild(st);
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
function getPin() {
|
|
326
|
-
|
|
328
|
+
var pin = "";
|
|
329
|
+
for (var i = 0; i < boxes.length; i++) pin += boxes[i].value;
|
|
330
|
+
return pin;
|
|
327
331
|
}
|
|
328
332
|
|
|
329
333
|
function updateBtn() {
|
|
330
|
-
var
|
|
334
|
+
var pin = getPin();
|
|
335
|
+
var ready = pin.length === 6 && /^[0-9]{6}$/.test(pin);
|
|
331
336
|
saveBtn.disabled = !ready;
|
|
332
337
|
saveBtn.style.opacity = ready ? "1" : "0.5";
|
|
333
338
|
}
|
|
334
339
|
|
|
340
|
+
function refreshFilled(idx) {
|
|
341
|
+
boxes[idx].classList.toggle("filled", boxes[idx].value.length > 0);
|
|
342
|
+
}
|
|
343
|
+
|
|
335
344
|
for (var i = 0; i < boxes.length; i++) {
|
|
336
345
|
(function (idx) {
|
|
337
346
|
boxes[idx].addEventListener("input", function () {
|
|
338
|
-
|
|
347
|
+
// Coerce to a single digit. If user types non-numeric, drop it.
|
|
339
348
|
var raw = this.value.replace(/[^0-9]/g, "");
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
if (v && idx < 5) boxes[idx + 1].focus();
|
|
349
|
+
this.value = raw.length > 0 ? raw.charAt(raw.length - 1) : "";
|
|
350
|
+
refreshFilled(idx);
|
|
351
|
+
if (this.value && idx < 5) boxes[idx + 1].focus();
|
|
344
352
|
updateBtn();
|
|
345
353
|
});
|
|
346
354
|
boxes[idx].addEventListener("keydown", function (e) {
|
|
347
355
|
if (e.key === "Backspace") {
|
|
348
|
-
if (!
|
|
349
|
-
|
|
356
|
+
if (!boxes[idx].value && idx > 0) {
|
|
357
|
+
boxes[idx - 1].value = "";
|
|
358
|
+
refreshFilled(idx - 1);
|
|
350
359
|
boxes[idx - 1].focus();
|
|
351
360
|
} else {
|
|
352
|
-
|
|
361
|
+
boxes[idx].value = "";
|
|
362
|
+
refreshFilled(idx);
|
|
353
363
|
}
|
|
354
364
|
updateBtn();
|
|
355
365
|
}
|
|
@@ -364,7 +374,8 @@ export function showForceChangePinOverlay() {
|
|
|
364
374
|
e.preventDefault();
|
|
365
375
|
var text = (e.clipboardData || window.clipboardData).getData("text").replace(/[^0-9]/g, "").substring(0, 6);
|
|
366
376
|
for (var j = 0; j < text.length && (idx + j) < 6; j++) {
|
|
367
|
-
|
|
377
|
+
boxes[idx + j].value = text.charAt(j);
|
|
378
|
+
refreshFilled(idx + j);
|
|
368
379
|
}
|
|
369
380
|
if (text.length > 0) {
|
|
370
381
|
var focusIdx = Math.min(idx + text.length, 5);
|
package/package.json
CHANGED