@kehto/paja 0.22.0 → 0.24.0

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.
@@ -522,6 +522,25 @@ function renderPajaHtml(config) {
522
522
  .spacer { flex: 1; min-width: 0; }
523
523
  .console-toggle { align-self: center; flex: 0 0 auto; width: 28px; height: 24px; padding: 0; display: inline-grid; place-items: center; color: var(--text); }
524
524
  .console-toggle-glyph { font-size: 15px; line-height: 1; }
525
+ #paja-gamepads { display: flex; align-items: center; gap: 7px; flex: 0 1 auto; min-width: 0; overflow-x: auto; }
526
+ #paja-gamepads:empty { display: none; }
527
+ .gamepad-indicator { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--pad-color); opacity: .65; padding: 3px 1px; }
528
+ .gamepad-indicator small { font-size: 10px; font-weight: 700; margin-left: 2px; }
529
+ .gamepad-indicator[data-activity="active"] { opacity: 1; background: color-mix(in srgb, var(--pad-color) 18%, transparent); border-radius: 5px; }
530
+ .gamepad-indicator[data-activity="active"] svg { animation: var(--pad-animation) var(--pad-duration) ease-in-out infinite; }
531
+ @keyframes gamepad-bounce { 50% { transform: translateY(var(--pad-lift)); } }
532
+ @keyframes gamepad-rock {
533
+ 25% { transform: rotate(var(--pad-turn)); }
534
+ 75% { transform: rotate(calc(-1 * var(--pad-turn))); }
535
+ }
536
+ @keyframes gamepad-pulse { 50% { transform: scale(1.18); } }
537
+ @keyframes gamepad-nudge {
538
+ 25% { transform: translateX(var(--pad-lift)); }
539
+ 75% { transform: translateX(calc(-1 * var(--pad-lift))); }
540
+ }
541
+ @media (prefers-reduced-motion: reduce) {
542
+ .gamepad-indicator[data-activity="active"] svg { animation: none; }
543
+ }
525
544
  .console-toggle-glyph::before { content: '\\00ab'; }
526
545
  html[data-paja-console="collapsed"] .console-toggle-glyph::before { content: '\\00bb'; }
527
546
  /* Collapsing is presentation-only: the console column, its top-bar cell,
@@ -707,6 +726,7 @@ function renderPajaHtml(config) {
707
726
  aria-label="${PAJA_CONSOLE_COLLAPSE_LABEL}"
708
727
  title="${PAJA_CONSOLE_COLLAPSE_LABEL}"
709
728
  ><span class="console-toggle-glyph" aria-hidden="true"></span></button>
729
+ <div id="paja-gamepads" role="group" aria-label="Connected controllers"></div>
710
730
  <div class="tabs" id="napplet-tabs" role="tablist" aria-label="Loaded napplets"></div>
711
731
  <div class="spacer"></div>
712
732
  <label>theme
@@ -1410,14 +1430,16 @@ var InstalledNappletCatalog = class {
1410
1430
  params: [...archetype.params]
1411
1431
  }))
1412
1432
  });
1433
+ const previous = this.records.get(record.id);
1413
1434
  this.records.set(record.id, record);
1414
- this.notify(record.id);
1435
+ this.notify(record.id, previous, record);
1415
1436
  return record;
1416
1437
  }
1417
1438
  /** Remove an artifact explicitly; frame teardown never calls this method. */
1418
1439
  remove(id) {
1440
+ const previous = this.records.get(id);
1419
1441
  const removed = this.records.delete(id);
1420
- if (removed) this.notify(id);
1442
+ if (removed) this.notify(id, previous);
1421
1443
  return removed;
1422
1444
  }
1423
1445
  /** Return whether a verified installation exists for a catalog ID. */
@@ -1463,8 +1485,12 @@ var InstalledNappletCatalog = class {
1463
1485
  this.listeners.add(listener);
1464
1486
  return () => this.listeners.delete(listener);
1465
1487
  }
1466
- notify(id) {
1467
- for (const listener of this.listeners) listener(id);
1488
+ notify(id, previous, current) {
1489
+ const archetypes = Object.freeze([.../* @__PURE__ */ new Set([
1490
+ ...(previous?.archetypes ?? []).map(({ slug }) => slug),
1491
+ ...(current?.archetypes ?? []).map(({ slug }) => slug)
1492
+ ])]);
1493
+ for (const listener of this.listeners) listener(id, archetypes);
1468
1494
  }
1469
1495
  };
1470
1496
  function copyPointer(pointer) {
@@ -2034,4 +2060,4 @@ export {
2034
2060
  probeTargetCors,
2035
2061
  startPajaServer
2036
2062
  };
2037
- //# sourceMappingURL=chunk-RMYEHOOR.js.map
2063
+ //# sourceMappingURL=chunk-ZRAED35O.js.map