@loupekit/sdk 0.10.8 → 0.10.9

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.
@@ -309,6 +309,14 @@ var Loupe = (() => {
309
309
  .composer .err { color: var(--pin); font-size: 11px; margin-top: 4px; }
310
310
  .composer .err:empty { display: none; }
311
311
 
312
+ /* Priority + change-type pickers, side by side under the attachments. */
313
+ .composer .meta2 { display: flex; gap: 6px; margin-top: 8px; }
314
+ .composer select.mini {
315
+ flex: 1; min-width: 0; font-size: 12px; padding: 6px 7px; border-radius: 7px;
316
+ border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); outline: none;
317
+ }
318
+ .composer select.mini:focus { border-color: var(--accent); }
319
+
312
320
  /* ------------------------------------------------------------ sidebar tabs */
313
321
  .tabs { display: flex; gap: 4px; flex: none; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
314
322
  .tabs .tab {
@@ -2519,9 +2527,25 @@ var Loupe = (() => {
2519
2527
  }
2520
2528
  return "queue";
2521
2529
  }
2530
+ var COMMENT_PRIORITIES = ["critical", "high", "medium", "low"];
2531
+ var PRIORITY_LABELS = {
2532
+ critical: "Critical",
2533
+ high: "High",
2534
+ medium: "Medium",
2535
+ low: "Low"
2536
+ };
2537
+ var CHANGE_TYPES = ["frontend", "backend", "api", "other"];
2538
+ var CHANGE_TYPE_LABELS = {
2539
+ frontend: "Frontend",
2540
+ backend: "Backend",
2541
+ api: "API",
2542
+ other: "Other"
2543
+ };
2544
+ var DEFAULT_PRIORITY = "medium";
2545
+ var DEFAULT_CHANGE_TYPE = "other";
2522
2546
 
2523
2547
  // src/app.ts
2524
- var SDK_VERSION = true ? "0.10.8" : "dev";
2548
+ var SDK_VERSION = true ? "0.10.9" : "dev";
2525
2549
  var DOCK_MODES = ["left", "right", "bottom", "float"];
2526
2550
  var RECORD_MAX_MS = 2e4;
2527
2551
  var MAX_FILES = 10;
@@ -3382,6 +3406,22 @@ var Loupe = (() => {
3382
3406
  attach.append(pick, input, chips, err);
3383
3407
  if (files.length) drawChips();
3384
3408
  const row = el("div", "row");
3409
+ const meta = el("div", "meta2");
3410
+ const prioSel = document.createElement("select");
3411
+ prioSel.className = "mini";
3412
+ prioSel.title = "Priority";
3413
+ prioSel.setAttribute("aria-label", "Priority");
3414
+ for (const p of COMMENT_PRIORITIES) {
3415
+ prioSel.append(optionEl(PRIORITY_LABELS[p], p, p === DEFAULT_PRIORITY));
3416
+ }
3417
+ const typeSel = document.createElement("select");
3418
+ typeSel.className = "mini";
3419
+ typeSel.title = "Change type";
3420
+ typeSel.setAttribute("aria-label", "Change type");
3421
+ for (const t of CHANGE_TYPES) {
3422
+ typeSel.append(optionEl(CHANGE_TYPE_LABELS[t], t, t === DEFAULT_CHANGE_TYPE));
3423
+ }
3424
+ meta.append(prioSel, typeSel);
3385
3425
  let box = null;
3386
3426
  if (target.kind !== "free" && !isRecording) {
3387
3427
  const chk = el("label", "chk");
@@ -3404,11 +3444,19 @@ var Loupe = (() => {
3404
3444
  title.oninput = sync;
3405
3445
  ta.oninput = sync;
3406
3446
  sync();
3407
- save.onclick = () => this.submit(target, title.value.trim(), ta.value.trim(), box ? box.checked : false, files.slice());
3447
+ save.onclick = () => this.submit(
3448
+ target,
3449
+ title.value.trim(),
3450
+ ta.value.trim(),
3451
+ box ? box.checked : false,
3452
+ files.slice(),
3453
+ prioSel.value,
3454
+ typeSel.value
3455
+ );
3408
3456
  btns.append(cancel, save);
3409
3457
  row.append(btns);
3410
- c.append(label, title, ta, attach, row);
3411
- const w = 320, h = 340;
3458
+ c.append(label, title, ta, attach, meta, row);
3459
+ const w = 320, h = 380;
3412
3460
  const left = Math.min(Math.max(8, x + 12), window.innerWidth - w - 8);
3413
3461
  const top = Math.min(Math.max(8, y + 12), window.innerHeight - h - 8);
3414
3462
  Object.assign(c.style, { display: "block", left: left + "px", top: top + "px" });
@@ -3419,7 +3467,7 @@ var Loupe = (() => {
3419
3467
  this.pending = null;
3420
3468
  this.pendingShot = void 0;
3421
3469
  }
3422
- async submit(target, title, body, withShot, files) {
3470
+ async submit(target, title, body, withShot, files, priority = DEFAULT_PRIORITY, changeType = DEFAULT_CHANGE_TYPE) {
3423
3471
  if (!title || !body) return;
3424
3472
  const saveBtn = this.composer.querySelector(".primary");
3425
3473
  if (saveBtn) {
@@ -3465,6 +3513,8 @@ var Loupe = (() => {
3465
3513
  title,
3466
3514
  body,
3467
3515
  status: "queue",
3516
+ priority,
3517
+ changeType,
3468
3518
  kind: target.kind,
3469
3519
  anchor,
3470
3520
  context,
@@ -3848,6 +3898,13 @@ var Loupe = (() => {
3848
3898
  function clampPx(n, min, max) {
3849
3899
  return Math.max(min, Math.min(max, n));
3850
3900
  }
3901
+ function optionEl(text, value, selected) {
3902
+ const o = document.createElement("option");
3903
+ o.value = value;
3904
+ o.textContent = text;
3905
+ o.selected = selected;
3906
+ return o;
3907
+ }
3851
3908
  function escapeHtml(s) {
3852
3909
  return s.replace(/[&<>"']/g, (m) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[m]);
3853
3910
  }