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.
@@ -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="tel" maxlength="1" inputmode="numeric" autocomplete="off" 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">' +
300
- '<input class="fcp-digit" type="tel" maxlength="1" inputmode="numeric" autocomplete="off" 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">' +
301
- '<input class="fcp-digit" type="tel" maxlength="1" inputmode="numeric" autocomplete="off" 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">' +
302
- '<input class="fcp-digit" type="tel" maxlength="1" inputmode="numeric" autocomplete="off" 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">' +
303
- '<input class="fcp-digit" type="tel" maxlength="1" inputmode="numeric" autocomplete="off" 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">' +
304
- '<input class="fcp-digit" type="tel" maxlength="1" inputmode="numeric" autocomplete="off" 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">' +
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
- var pinValues = ["", "", "", "", "", ""];
315
- var _settingDigit = false;
316
-
317
- function setDigit(idx, v) {
318
- pinValues[idx] = v;
319
- _settingDigit = true;
320
- boxes[idx].value = v ? "\u2022" : "";
321
- _settingDigit = false;
322
- boxes[idx].classList.toggle("filled", v.length > 0);
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
- return pinValues.join("");
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 ready = getPin().length === 6;
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
- if (_settingDigit) return;
347
+ // Coerce to a single digit. If user types non-numeric, drop it.
339
348
  var raw = this.value.replace(/[^0-9]/g, "");
340
- if (!raw) { setDigit(idx, ""); updateBtn(); return; }
341
- var v = raw.charAt(raw.length - 1);
342
- setDigit(idx, v);
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 (!pinValues[idx] && idx > 0) {
349
- setDigit(idx - 1, "");
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
- setDigit(idx, "");
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
- setDigit(idx + j, text.charAt(j));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "2.36.2-beta.2",
3
+ "version": "2.36.2-beta.3",
4
4
  "description": "Self-hosted team workspace for Claude Code and Codex. Multi-user, browser-based, with persistent AI mates.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js",