@loupekit/sdk 0.10.8 → 0.10.9-next.54

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/dist/index.js CHANGED
@@ -282,6 +282,14 @@ var STYLES = (
282
282
  .composer .err { color: var(--pin); font-size: 11px; margin-top: 4px; }
283
283
  .composer .err:empty { display: none; }
284
284
 
285
+ /* Priority + change-type pickers, side by side under the attachments. */
286
+ .composer .meta2 { display: flex; gap: 6px; margin-top: 8px; }
287
+ .composer select.mini {
288
+ flex: 1; min-width: 0; font-size: 12px; padding: 6px 7px; border-radius: 7px;
289
+ border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); outline: none;
290
+ }
291
+ .composer select.mini:focus { border-color: var(--accent); }
292
+
285
293
  /* ------------------------------------------------------------ sidebar tabs */
286
294
  .tabs { display: flex; gap: 4px; flex: none; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
287
295
  .tabs .tab {
@@ -2492,9 +2500,25 @@ function normalizeStatus(value) {
2492
2500
  }
2493
2501
  return "queue";
2494
2502
  }
2503
+ var COMMENT_PRIORITIES = ["critical", "high", "medium", "low"];
2504
+ var PRIORITY_LABELS = {
2505
+ critical: "Critical",
2506
+ high: "High",
2507
+ medium: "Medium",
2508
+ low: "Low"
2509
+ };
2510
+ var CHANGE_TYPES = ["frontend", "backend", "api", "other"];
2511
+ var CHANGE_TYPE_LABELS = {
2512
+ frontend: "Frontend",
2513
+ backend: "Backend",
2514
+ api: "API",
2515
+ other: "Other"
2516
+ };
2517
+ var DEFAULT_PRIORITY = "medium";
2518
+ var DEFAULT_CHANGE_TYPE = "other";
2495
2519
 
2496
2520
  // src/app.ts
2497
- var SDK_VERSION = true ? "0.10.8" : "dev";
2521
+ var SDK_VERSION = true ? "0.10.9" : "dev";
2498
2522
  var DOCK_MODES = ["left", "right", "bottom", "float"];
2499
2523
  var RECORD_MAX_MS = 2e4;
2500
2524
  var MAX_FILES = 10;
@@ -3355,6 +3379,22 @@ var LoupeApp = class {
3355
3379
  attach.append(pick, input, chips, err);
3356
3380
  if (files.length) drawChips();
3357
3381
  const row = el("div", "row");
3382
+ const meta = el("div", "meta2");
3383
+ const prioSel = document.createElement("select");
3384
+ prioSel.className = "mini";
3385
+ prioSel.title = "Priority";
3386
+ prioSel.setAttribute("aria-label", "Priority");
3387
+ for (const p of COMMENT_PRIORITIES) {
3388
+ prioSel.append(optionEl(PRIORITY_LABELS[p], p, p === DEFAULT_PRIORITY));
3389
+ }
3390
+ const typeSel = document.createElement("select");
3391
+ typeSel.className = "mini";
3392
+ typeSel.title = "Change type";
3393
+ typeSel.setAttribute("aria-label", "Change type");
3394
+ for (const t of CHANGE_TYPES) {
3395
+ typeSel.append(optionEl(CHANGE_TYPE_LABELS[t], t, t === DEFAULT_CHANGE_TYPE));
3396
+ }
3397
+ meta.append(prioSel, typeSel);
3358
3398
  let box = null;
3359
3399
  if (target.kind !== "free" && !isRecording) {
3360
3400
  const chk = el("label", "chk");
@@ -3377,11 +3417,19 @@ var LoupeApp = class {
3377
3417
  title.oninput = sync;
3378
3418
  ta.oninput = sync;
3379
3419
  sync();
3380
- save.onclick = () => this.submit(target, title.value.trim(), ta.value.trim(), box ? box.checked : false, files.slice());
3420
+ save.onclick = () => this.submit(
3421
+ target,
3422
+ title.value.trim(),
3423
+ ta.value.trim(),
3424
+ box ? box.checked : false,
3425
+ files.slice(),
3426
+ prioSel.value,
3427
+ typeSel.value
3428
+ );
3381
3429
  btns.append(cancel, save);
3382
3430
  row.append(btns);
3383
- c.append(label, title, ta, attach, row);
3384
- const w = 320, h = 340;
3431
+ c.append(label, title, ta, attach, meta, row);
3432
+ const w = 320, h = 380;
3385
3433
  const left = Math.min(Math.max(8, x + 12), window.innerWidth - w - 8);
3386
3434
  const top = Math.min(Math.max(8, y + 12), window.innerHeight - h - 8);
3387
3435
  Object.assign(c.style, { display: "block", left: left + "px", top: top + "px" });
@@ -3392,7 +3440,7 @@ var LoupeApp = class {
3392
3440
  this.pending = null;
3393
3441
  this.pendingShot = void 0;
3394
3442
  }
3395
- async submit(target, title, body, withShot, files) {
3443
+ async submit(target, title, body, withShot, files, priority = DEFAULT_PRIORITY, changeType = DEFAULT_CHANGE_TYPE) {
3396
3444
  if (!title || !body) return;
3397
3445
  const saveBtn = this.composer.querySelector(".primary");
3398
3446
  if (saveBtn) {
@@ -3438,6 +3486,8 @@ var LoupeApp = class {
3438
3486
  title,
3439
3487
  body,
3440
3488
  status: "queue",
3489
+ priority,
3490
+ changeType,
3441
3491
  kind: target.kind,
3442
3492
  anchor,
3443
3493
  context,
@@ -3821,6 +3871,13 @@ function clamp(n) {
3821
3871
  function clampPx(n, min, max) {
3822
3872
  return Math.max(min, Math.min(max, n));
3823
3873
  }
3874
+ function optionEl(text, value, selected) {
3875
+ const o = document.createElement("option");
3876
+ o.value = value;
3877
+ o.textContent = text;
3878
+ o.selected = selected;
3879
+ return o;
3880
+ }
3824
3881
  function escapeHtml(s) {
3825
3882
  return s.replace(/[&<>"']/g, (m) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[m]);
3826
3883
  }