@kehto/paja 0.24.1 → 0.24.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.
@@ -506,7 +506,6 @@ function renderPajaHtml(config) {
506
506
  --muted: #a9ad9f;
507
507
  --accent: #d8c36a;
508
508
  --paja-console-column: minmax(320px, 380px);
509
- --paja-bar-reveal: 6px;
510
509
  }
511
510
  * { box-sizing: border-box; }
512
511
  html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
@@ -554,26 +553,6 @@ function renderPajaHtml(config) {
554
553
  html[data-paja-console="collapsed"] .top-console,
555
554
  html[data-paja-console="collapsed"] .console,
556
555
  html[data-paja-console="collapsed"] .bottom { display: none; }
557
- /* With a hover-capable pointer the whole top bar hides with the drawer and
558
- returns from a --paja-bar-reveal strip at the viewport edge. The strip
559
- is the bar's own box, so hover containment keeps the reveal stable; the
560
- bar's children stay inert while it is parked, and :focus-within restores
561
- it for keyboard users. Touch and stacked layouts keep the bar visible,
562
- because they have no hover to restore it and the drawer toggle lives
563
- inside it. */
564
- @media (hover: hover) and (pointer: fine) and (min-width: 901px) {
565
- html[data-paja-console="collapsed"] body { grid-template-rows: minmax(0, 1fr); }
566
- html[data-paja-console="collapsed"] .top {
567
- position: fixed; inset: 0 0 auto 0; height: 38px; z-index: 5;
568
- transform: translateY(calc(-100% + var(--paja-bar-reveal)));
569
- transition: transform 120ms;
570
- }
571
- html[data-paja-console="collapsed"] .top > * { opacity: 0; pointer-events: none; transition: opacity 120ms; }
572
- html[data-paja-console="collapsed"] .top:hover,
573
- html[data-paja-console="collapsed"] .top:focus-within { transform: none; }
574
- html[data-paja-console="collapsed"] .top:hover > *,
575
- html[data-paja-console="collapsed"] .top:focus-within > * { opacity: 1; pointer-events: auto; }
576
- }
577
556
  .tabs { display: flex; align-items: stretch; align-self: flex-end; gap: 4px; min-width: 120px; max-width: min(100%, 760px); overflow-x: auto; scrollbar-width: thin; }
578
557
  .tabs:empty { display: none; }
579
558
  .tab { min-width: 116px; max-width: 240px; height: 30px; display: grid; grid-template-columns: minmax(0, 1fr) 24px 24px; align-items: center; gap: 2px; border: 1px solid var(--line); border-bottom-color: transparent; background: #151815; color: var(--muted); border-radius: 5px 5px 0 0; padding: 0 2px 0 9px; }
@@ -932,6 +911,8 @@ import {
932
911
  fetchBlob,
933
912
  isNappletManifestKind,
934
913
  NAPPLET_KIND_NAMED,
914
+ NAPPLET_KIND_ROOT,
915
+ NAPPLET_KIND_SNAPSHOT,
935
916
  NAPPLET_KINDS,
936
917
  openNappletArtifactCache,
937
918
  resolveNapplet
@@ -1051,7 +1032,7 @@ function injectPajaRuntimeCsp(html, origins) {
1051
1032
  async function resolvePointerEvent(pointer, pool, relays, maxWaitMs) {
1052
1033
  const filter = pointer.type === "naddr" ? addressableFilter(pointer) : eventFilter(pointer);
1053
1034
  const result = await queryPointerRelays(pool, relays, filter, maxWaitMs);
1054
- const event = result.events.filter((candidate) => matchesPointer(pointer, candidate)).sort((a, b) => b.created_at - a.created_at)[0];
1035
+ const event = result.events.filter((candidate) => matchesPointer(pointer, candidate)).sort((a, b) => b.created_at - a.created_at || a.id.localeCompare(b.id))[0];
1055
1036
  if (!event) {
1056
1037
  if (result.timedOut) {
1057
1038
  throw new Error(
@@ -1141,13 +1122,22 @@ function normalizeMaxWaitMs(value) {
1141
1122
  return Math.floor(value);
1142
1123
  }
1143
1124
  function addressableFilter(pointer) {
1144
- if (pointer.kind !== NAPPLET_KIND_NAMED) {
1145
- throw new Error(`naddr kind ${pointer.kind} is not a named NIP-5D napplet manifest kind.`);
1125
+ if (pointer.kind === NAPPLET_KIND_SNAPSHOT) {
1126
+ throw new Error("NIP-5D snapshot kind 5129 requires a nevent pointer with its signed event ID.");
1127
+ }
1128
+ if (pointer.kind !== NAPPLET_KIND_NAMED && pointer.kind !== NAPPLET_KIND_ROOT) {
1129
+ throw new Error(`naddr kind ${pointer.kind} is not a root or named NIP-5D napplet manifest kind.`);
1130
+ }
1131
+ if (pointer.kind === NAPPLET_KIND_ROOT && pointer.identifier !== "") {
1132
+ throw new Error("NIP-5D root naddr requires an empty identifier.");
1133
+ }
1134
+ if (pointer.kind === NAPPLET_KIND_NAMED && pointer.identifier === "") {
1135
+ throw new Error("NIP-5D named naddr requires a non-empty identifier.");
1146
1136
  }
1147
1137
  return {
1148
- kinds: [NAPPLET_KIND_NAMED],
1138
+ kinds: [pointer.kind],
1149
1139
  authors: [pointer.pubkey],
1150
- "#d": [pointer.identifier],
1140
+ ...pointer.kind === NAPPLET_KIND_NAMED ? { "#d": [pointer.identifier] } : {},
1151
1141
  limit: 1
1152
1142
  };
1153
1143
  }
@@ -1166,7 +1156,7 @@ function matchesPointer(pointer, event) {
1166
1156
  if (pointer.kind && event.kind !== pointer.kind) return false;
1167
1157
  return true;
1168
1158
  }
1169
- return event.kind === pointer.kind && event.pubkey === pointer.pubkey && event.tags.some((tag) => tag[0] === "d" && tag[1] === pointer.identifier);
1159
+ return event.kind === pointer.kind && event.pubkey === pointer.pubkey && (pointer.kind === NAPPLET_KIND_ROOT || event.tags.some((tag) => tag[0] === "d" && tag[1] === pointer.identifier));
1170
1160
  }
1171
1161
  function uniqueRelayUrls(values) {
1172
1162
  const out = [];
@@ -2060,4 +2050,4 @@ export {
2060
2050
  probeTargetCors,
2061
2051
  startPajaServer
2062
2052
  };
2063
- //# sourceMappingURL=chunk-ZRAED35O.js.map
2053
+ //# sourceMappingURL=chunk-PLZYKUBM.js.map