@kehto/paja 0.21.4 → 0.22.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.
- package/README.md +15 -2
- package/dist/browser-host.js +547 -118
- package/dist/browser-host.js.map +1 -1
- package/dist/{chunk-HG2CUTQC.js → chunk-RMYEHOOR.js} +75 -5
- package/dist/chunk-RMYEHOOR.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-HG2CUTQC.js.map +0 -1
|
@@ -480,6 +480,12 @@ var PAJA_CONSOLE_PANEL_ID = "paja-console";
|
|
|
480
480
|
var PAJA_CONSOLE_TOGGLE_ID = "paja-console-toggle";
|
|
481
481
|
var PAJA_CONSOLE_COLLAPSE_LABEL = "Collapse the Paja development console";
|
|
482
482
|
|
|
483
|
+
// src/browser-relay-panel.ts
|
|
484
|
+
import { normalizeURL } from "nostr-tools/utils";
|
|
485
|
+
var PAJA_EVENT_COUNTER_RESET_ID = "event-counter-reset";
|
|
486
|
+
var PAJA_EVENT_COUNTER_RESET_LABEL = "reset";
|
|
487
|
+
var PAJA_EVENT_COUNTER_RESET_TITLE = "reset counter";
|
|
488
|
+
|
|
483
489
|
// src/host-page.ts
|
|
484
490
|
function renderPajaHtml(config) {
|
|
485
491
|
const configJson = escapeJsonForHtml(JSON.stringify(config));
|
|
@@ -500,6 +506,7 @@ function renderPajaHtml(config) {
|
|
|
500
506
|
--muted: #a9ad9f;
|
|
501
507
|
--accent: #d8c36a;
|
|
502
508
|
--paja-console-column: minmax(320px, 380px);
|
|
509
|
+
--paja-bar-reveal: 6px;
|
|
503
510
|
}
|
|
504
511
|
* { box-sizing: border-box; }
|
|
505
512
|
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; }
|
|
@@ -517,13 +524,37 @@ function renderPajaHtml(config) {
|
|
|
517
524
|
.console-toggle-glyph { font-size: 15px; line-height: 1; }
|
|
518
525
|
.console-toggle-glyph::before { content: '\\00ab'; }
|
|
519
526
|
html[data-paja-console="collapsed"] .console-toggle-glyph::before { content: '\\00bb'; }
|
|
520
|
-
/* Collapsing is presentation-only: the console column
|
|
521
|
-
leave the grid and the stage reclaims the
|
|
522
|
-
iframe keeps its identity, generation, and
|
|
527
|
+
/* Collapsing is presentation-only: the console column, its top-bar cell,
|
|
528
|
+
and the bottom status bar leave the grid and the stage reclaims the
|
|
529
|
+
full width, so the target iframe keeps its identity, generation, and
|
|
530
|
+
loaded napplet. The body track list shrinks with them, because
|
|
531
|
+
display:none alone would leave the footer's 30px row reserved. */
|
|
523
532
|
html[data-paja-console="collapsed"] .top,
|
|
524
533
|
html[data-paja-console="collapsed"] main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
|
|
534
|
+
html[data-paja-console="collapsed"] body { grid-template-rows: 38px minmax(0, 1fr); }
|
|
525
535
|
html[data-paja-console="collapsed"] .top-console,
|
|
526
|
-
html[data-paja-console="collapsed"] .console
|
|
536
|
+
html[data-paja-console="collapsed"] .console,
|
|
537
|
+
html[data-paja-console="collapsed"] .bottom { display: none; }
|
|
538
|
+
/* With a hover-capable pointer the whole top bar hides with the drawer and
|
|
539
|
+
returns from a --paja-bar-reveal strip at the viewport edge. The strip
|
|
540
|
+
is the bar's own box, so hover containment keeps the reveal stable; the
|
|
541
|
+
bar's children stay inert while it is parked, and :focus-within restores
|
|
542
|
+
it for keyboard users. Touch and stacked layouts keep the bar visible,
|
|
543
|
+
because they have no hover to restore it and the drawer toggle lives
|
|
544
|
+
inside it. */
|
|
545
|
+
@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
|
|
546
|
+
html[data-paja-console="collapsed"] body { grid-template-rows: minmax(0, 1fr); }
|
|
547
|
+
html[data-paja-console="collapsed"] .top {
|
|
548
|
+
position: fixed; inset: 0 0 auto 0; height: 38px; z-index: 5;
|
|
549
|
+
transform: translateY(calc(-100% + var(--paja-bar-reveal)));
|
|
550
|
+
transition: transform 120ms;
|
|
551
|
+
}
|
|
552
|
+
html[data-paja-console="collapsed"] .top > * { opacity: 0; pointer-events: none; transition: opacity 120ms; }
|
|
553
|
+
html[data-paja-console="collapsed"] .top:hover,
|
|
554
|
+
html[data-paja-console="collapsed"] .top:focus-within { transform: none; }
|
|
555
|
+
html[data-paja-console="collapsed"] .top:hover > *,
|
|
556
|
+
html[data-paja-console="collapsed"] .top:focus-within > * { opacity: 1; pointer-events: auto; }
|
|
557
|
+
}
|
|
527
558
|
.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; }
|
|
528
559
|
.tabs:empty { display: none; }
|
|
529
560
|
.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; }
|
|
@@ -553,6 +584,7 @@ function renderPajaHtml(config) {
|
|
|
553
584
|
.resource-servers textarea { width: 100%; min-width: 0; padding: 6px; resize: vertical; }
|
|
554
585
|
.resource-servers small, .resource-servers [role="status"] { color: var(--muted); overflow-wrap: anywhere; }
|
|
555
586
|
.switch-grid, .acl-grid { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
587
|
+
.hint { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
|
|
556
588
|
.toggle { height: 24px; padding: 0 8px; color: var(--muted); }
|
|
557
589
|
.toggle[data-enabled="true"] { color: var(--text); border-color: #5f724f; background: #24301f; }
|
|
558
590
|
.toggle[data-enabled="false"] { color: #8d9187; border-color: #453536; background: #241d1d; }
|
|
@@ -572,6 +604,32 @@ function renderPajaHtml(config) {
|
|
|
572
604
|
.log-body { min-width: 0; display: grid; gap: 2px; }
|
|
573
605
|
.log-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
574
606
|
.log-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e6a5a5; }
|
|
607
|
+
.event-list { min-height: 44px; max-height: 34vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: #0b0d0b; padding: 4px 0; }
|
|
608
|
+
.event-box + .event-box { margin-top: 6px; border-top: 1px solid #1b1f1a; }
|
|
609
|
+
.event-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 5px 8px 3px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
|
|
610
|
+
.event-box-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
|
|
611
|
+
.event-box-count { color: var(--accent); }
|
|
612
|
+
.event-box-note { color: var(--muted); font-style: italic; text-transform: none; letter-spacing: normal; }
|
|
613
|
+
.event-relay { padding: 1px 0 2px; }
|
|
614
|
+
.event-relay-head { display: grid; grid-template-columns: minmax(0, 1fr) 56px 22px auto; align-items: center; gap: 6px; padding: 2px 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
|
|
615
|
+
.event-relay-url { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
|
|
616
|
+
.event-bar { display: block; height: 5px; border-radius: 3px; background: #1b1f1a; overflow: hidden; }
|
|
617
|
+
.event-bar-fill { display: block; height: 100%; background: var(--accent); }
|
|
618
|
+
.event-relay[data-relay-count="0"] .event-bar { background: #141714; }
|
|
619
|
+
.event-relay-count { color: var(--accent); text-align: right; }
|
|
620
|
+
.event-relay[data-relay-count="0"] .event-relay-count { color: var(--muted); }
|
|
621
|
+
.event-relay-idle { color: var(--muted); font-size: 10px; font-style: italic; }
|
|
622
|
+
.event-kinds { padding-left: 16px; }
|
|
623
|
+
.event-row { display: grid; grid-template-columns: 64px 12px minmax(0, 1fr); align-items: baseline; gap: 6px; padding: 2px 8px 2px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
|
|
624
|
+
.event-kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: var(--text); }
|
|
625
|
+
.event-separator { color: var(--muted); text-align: center; }
|
|
626
|
+
.event-count { color: var(--accent); text-align: left; }
|
|
627
|
+
.event-empty { padding: 4px 8px; color: var(--muted); font-style: italic; font-size: 11px; }
|
|
628
|
+
.section-total { color: var(--muted); font-size: 11px; margin-left: auto; }
|
|
629
|
+
.section-total:empty { display: none; }
|
|
630
|
+
.section-reset { flex: 0 0 auto; height: 18px; margin-left: 8px; padding: 0 6px; color: var(--muted); font-size: 10px; text-transform: lowercase; }
|
|
631
|
+
.section-total:empty + .section-reset { margin-left: auto; }
|
|
632
|
+
.section-total ~ .section-chevron { margin-left: 8px; }
|
|
575
633
|
.stage { min-width: 0; min-height: 0; position: relative; background: #050705; }
|
|
576
634
|
.empty-stage { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
|
|
577
635
|
.empty-stage[hidden] { display: none; }
|
|
@@ -666,10 +724,12 @@ function renderPajaHtml(config) {
|
|
|
666
724
|
<details class="section" id="paja-section-interfaces" data-paja-section="interfaces" open>
|
|
667
725
|
<summary class="section-title">Interfaces<span class="section-chevron" aria-hidden="true">\u203A</span></summary><div class="section-body">
|
|
668
726
|
<div class="switch-grid" id="interface-toggles"></div>
|
|
727
|
+
<p class="hint" id="paja-fs-support" role="status"></p>
|
|
669
728
|
</div></details>
|
|
670
729
|
<details class="section" id="paja-section-acl" data-paja-section="acl" open>
|
|
671
730
|
<summary class="section-title">ACL<span class="section-chevron" aria-hidden="true">\u203A</span></summary><div class="section-body">
|
|
672
731
|
<div class="acl-grid" id="acl-controls"></div>
|
|
732
|
+
<p class="hint">ACL grants allow operations; they do not add missing browser APIs. See Interfaces for FS picker support.</p>
|
|
673
733
|
</div></details>
|
|
674
734
|
<details class="section" id="paja-section-signer" data-paja-section="signer" open>
|
|
675
735
|
<summary class="section-title">Signer<span class="section-chevron" aria-hidden="true">\u203A</span></summary><div class="section-body">
|
|
@@ -695,6 +755,16 @@ function renderPajaHtml(config) {
|
|
|
695
755
|
</div>
|
|
696
756
|
<div class="log-list" id="message-log" aria-live="polite"></div>
|
|
697
757
|
</div></details>
|
|
758
|
+
<details class="section" id="paja-section-events" data-paja-section="events" open>
|
|
759
|
+
<summary class="section-title">Events<span class="section-total" id="event-kind-total" aria-hidden="true"></span><button
|
|
760
|
+
type="button"
|
|
761
|
+
id="${PAJA_EVENT_COUNTER_RESET_ID}"
|
|
762
|
+
class="section-reset"
|
|
763
|
+
title="${PAJA_EVENT_COUNTER_RESET_TITLE}"
|
|
764
|
+
aria-label="${PAJA_EVENT_COUNTER_RESET_TITLE}"
|
|
765
|
+
>${PAJA_EVENT_COUNTER_RESET_LABEL}</button><span class="section-chevron" aria-hidden="true">\u203A</span></summary><div class="section-body">
|
|
766
|
+
<div class="event-list" id="event-kind-counts" aria-label="Relay receipts by read reason, relay, and event kind"></div>
|
|
767
|
+
</div></details>
|
|
698
768
|
</aside>
|
|
699
769
|
${renderStage(config, targetLabel)}
|
|
700
770
|
</main>
|
|
@@ -1964,4 +2034,4 @@ export {
|
|
|
1964
2034
|
probeTargetCors,
|
|
1965
2035
|
startPajaServer
|
|
1966
2036
|
};
|
|
1967
|
-
//# sourceMappingURL=chunk-
|
|
2037
|
+
//# sourceMappingURL=chunk-RMYEHOOR.js.map
|