@xenosystem/blocks 0.13.10 → 0.13.12

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.
@@ -1,6 +1,9 @@
1
1
  import {
2
+ ChevronGlyph,
3
+ CollapseGlyph,
2
4
  DiamondIcon,
3
5
  EntryIcon,
6
+ ExpandGlyph,
4
7
  EyedropperIcon,
5
8
  ICONS,
6
9
  KindGlyph,
@@ -9,6 +12,7 @@ import {
9
12
  NextIcon,
10
13
  PrevIcon,
11
14
  RedoIcon,
15
+ RefreshGlyph,
12
16
  ResetIcon,
13
17
  StopwatchIcon,
14
18
  SwapIcon,
@@ -18,13 +22,7 @@ import {
18
22
  VisibilityIcon,
19
23
  XIcon,
20
24
  XIcon2
21
- } from "../chunk-W4PTX2Y4.js";
22
- import {
23
- ChevronGlyph,
24
- CollapseGlyph,
25
- ExpandGlyph,
26
- RefreshGlyph
27
- } from "../chunk-K7YLLV2W.js";
25
+ } from "../chunk-5BVZMAD2.js";
28
26
  import "../chunk-2KG3PWR4.js";
29
27
 
30
28
  // src/edit/layers/panel.ts
@@ -1,10 +1,8 @@
1
1
  import {
2
2
  ICONS,
3
- ICON_UNITS
4
- } from "../chunk-W4PTX2Y4.js";
5
- import {
3
+ ICON_UNITS,
6
4
  Svg
7
- } from "../chunk-K7YLLV2W.js";
5
+ } from "../chunk-5BVZMAD2.js";
8
6
  import "../chunk-2KG3PWR4.js";
9
7
  export {
10
8
  ICONS,
@@ -1,5 +1,5 @@
1
- import { PanelModule, PanelManifest } from '@xenosystem/block-sdk';
2
- import { ReactNode } from 'react';
1
+ import { PanelModule, PanelManifest, BlockDeclaration } from '@xenosystem/block-sdk';
2
+ import { ReactNode, ReactElement } from 'react';
3
3
  import { ThrottleClock } from '@xenosystem/tree-core';
4
4
 
5
5
  /**
@@ -433,6 +433,18 @@ declare class ConsoleController {
433
433
  /** Every source seen, with its contribution count and current visibility. */
434
434
  sources(): XenoLogSource[];
435
435
  /** Follow the tail. Auto-disabled by the view when the user scrolls up. */
436
+ private expandedId;
437
+ private viewport;
438
+ /** Which record's data is expanded under its row, if any. */
439
+ getExpanded(): string | null;
440
+ /** Toggle a record's expanded detail (only records carrying `data` expand). */
441
+ toggleExpanded(recordId: string): void;
442
+ /** The scroller reports its viewport; the view state windows the rows from it. */
443
+ setViewport(height: number, scrollTop: number): void;
444
+ getViewport(): {
445
+ height: number;
446
+ scrollTop: number;
447
+ };
436
448
  setFollow(follow: boolean): void;
437
449
  /** Collapse adjacent duplicates. */
438
450
  setCollapse(collapse: boolean): void;
@@ -512,7 +524,101 @@ declare const CONSOLE_PANEL_ID = "xeno.core.console";
512
524
  declare const consoleManifest: PanelManifest;
513
525
 
514
526
  /**
515
- * The Console panel view — virtualized, follow-tail, per-source chips.
527
+ * The Console panel AS A DECLARATION — the fourteenth declared block, and the second virtualized list
528
+ * (after history): a multiplexed log.
529
+ *
530
+ * Everything drawn is data: the toolbar (search, the minimum-level control, the error/warn counts,
531
+ * copy and clear), the per-source `FilterChip`s (only when there is more than one stream), the
532
+ * empty states, the windowed rows — each a `Row` whose label is the time, the level `Badge`, the
533
+ * source and the message, with a repeat badge trailing and the expanded record as a `Code` block
534
+ * under it — and the status bar. What a declaration cannot hold: the SCROLLER (`console/Scroller`,
535
+ * the element the virtualizer measures and follow-mode pins to the bottom) — the one runtime-bound
536
+ * unit. Which row is expanded lives in the controller now, not in React state.
537
+ */
538
+
539
+ interface ConsoleViewRow {
540
+ id: string;
541
+ time?: string;
542
+ level: string;
543
+ tone: 'neutral' | 'info' | 'warning' | 'error';
544
+ source?: string;
545
+ message: string;
546
+ repeat?: string;
547
+ expanded: boolean;
548
+ detail?: string;
549
+ }
550
+ interface ConsoleViewSource {
551
+ id: string;
552
+ label: string;
553
+ on: boolean;
554
+ title: string;
555
+ }
556
+ interface ConsoleViewModel {
557
+ search: string;
558
+ levels: {
559
+ value: string;
560
+ label: string;
561
+ }[];
562
+ level: string;
563
+ errors?: string;
564
+ warns?: string;
565
+ multiSource: boolean;
566
+ sources: ConsoleViewSource[];
567
+ empty: boolean;
568
+ emptyTitle: string;
569
+ emptyHint: string;
570
+ listed: boolean;
571
+ rowHeight: number;
572
+ totalHeight: number;
573
+ offsetTop: number;
574
+ rows: ConsoleViewRow[];
575
+ countLabel: string;
576
+ followLabel?: string;
577
+ }
578
+ type ConsoleUiIntent = {
579
+ kind: 'search';
580
+ value: string;
581
+ } | {
582
+ kind: 'level';
583
+ level: string;
584
+ } | {
585
+ kind: 'copyVisible';
586
+ } | {
587
+ kind: 'clear';
588
+ } | {
589
+ kind: 'source';
590
+ id: string;
591
+ on: boolean;
592
+ } | {
593
+ kind: 'row';
594
+ id: string;
595
+ } | {
596
+ kind: 'contextMenu';
597
+ id: string;
598
+ x: number;
599
+ y: number;
600
+ };
601
+ interface ConsoleViewOptions {
602
+ rowHeight?: number;
603
+ showTimestamps?: boolean;
604
+ emptyHint?: string;
605
+ }
606
+ /** Derive the view from the live controller — the runtime calls this on every draw. */
607
+ declare function consoleViewState(c: ConsoleController, options?: ConsoleViewOptions): ConsoleViewModel;
608
+ declare function applyConsoleUi(c: ConsoleController, intent: ConsoleUiIntent): void;
609
+ declare const consoleViewManifest: PanelManifest;
610
+ declare const BEHAVIOURS: {
611
+ 'ops/consolePanelView': (inputs: Record<string, unknown>) => ConsoleViewModel;
612
+ };
613
+ /** The runtime-bound unit: the scroller the virtualizer measures and follow-mode pins. */
614
+ declare const CONSOLE_RUNTIME_UNITS: readonly ["console/Scroller"];
615
+ declare const CONSOLE_DECLARATION: BlockDeclaration;
616
+
617
+ /**
618
+ * The Console panel view — the CODE VIEW of `CONSOLE_DECLARATION`, drawing the same
619
+ * `ConsoleViewModel` byte-identical (the equivalence suite holds the two together). The one thing this
620
+ * file owns that the declaration cannot is `console/Scroller`: the element the virtualizer measures,
621
+ * whose scroll position the controller mirrors, and which follow-mode pins to the bottom.
516
622
  *
517
623
  * Composes `@xenosystem/components/chrome`; the host must ensure `@xenosystem/workbench/primitives.css` is
518
624
  * present.
@@ -521,14 +627,18 @@ declare const consoleManifest: PanelManifest;
521
627
  */
522
628
 
523
629
  /** Props for {@link ConsolePanelView}. */
524
- interface ConsolePanelViewProps {
630
+ interface ConsolePanelViewProps extends ConsoleViewOptions {
525
631
  controller: ConsoleController;
526
- rowHeight?: number;
527
- showTimestamps?: boolean;
528
- emptyHint?: string;
529
632
  }
633
+ /** `console/Scroller` — measures the viewport for the virtualizer, mirrors scroll, pins follow-mode to the bottom. */
634
+ declare function ConsoleScroller({ controller, rowHeight, children }: {
635
+ controller: ConsoleController;
636
+ rowHeight?: number;
637
+ children?: ReactNode;
638
+ }): ReactElement;
639
+ declare function consoleRuntimeComponents(controller: ConsoleController, rowHeight?: number): Record<(typeof CONSOLE_RUNTIME_UNITS)[number], React.ComponentType<any>>;
530
640
  /** The Console panel view. */
531
- declare function ConsolePanelView({ controller, rowHeight, showTimestamps, emptyHint, }: ConsolePanelViewProps): ReactNode;
641
+ declare function ConsolePanelView({ controller, ...options }: ConsolePanelViewProps): ReactNode;
532
642
 
533
643
  /**
534
644
  * The `xeno.core.runs` contract.
@@ -2232,4 +2342,4 @@ interface DiffPanelViewProps {
2232
2342
  /** The Diff panel view. */
2233
2343
  declare function DiffPanelView({ controller, highlighter, review }: DiffPanelViewProps): ReactNode;
2234
2344
 
2235
- export { ALL_STATUSES, CONSOLE_PANEL_ID, ConsoleController, type ConsoleControllerOptions, type ConsoleHostBridge, type ConsolePanelState, ConsolePanelView, type ConsolePanelViewProps, type ConsoleRenderContext, type ConsoleViewState, type CreateConsolePanelOptions, type CreateDiffPanelOptions, type CreateRunsPanelOptions, type CreateTerminalPanelOptions, DEFAULT_MAX_STEP_DEPTH, DIFF_PANEL_ID, DiffController, type DiffControllerOptions, type DiffFileView, type DiffHostBridge, type DiffPanelState, DiffPanelView, type DiffPanelViewProps, type DiffRenderContext, type DiffViewState, type FlattenOptions, LEVEL_ORDER, MESSAGE_ELISION, REDACTION_CARRY, RUNS_PANEL_ID, RUN_PATH_SEPARATOR, RUN_STATUSES, RunsController, type RunsControllerOptions, type RunsHostBridge, type RunsPanelState, RunsPanelView, type RunsPanelViewProps, type RunsRenderContext, type RunsViewState, TERMINAL_PANEL_ID, TERMINAL_STATUSES, TerminalController, type TerminalControllerOptions, type TerminalHostBridge, type TerminalInstanceView, type TerminalPanelState, TerminalPanelView, type TerminalPanelViewProps, type TerminalRenderContext, type TerminalViewState, XENO_TERMINAL_THEME_KEYS, type XenoDiffAction, type XenoDiffDecision, type XenoDiffDecisionIntent, type XenoDiffDecisionState, type XenoDiffFile, type XenoDiffFileOmission, type XenoDiffHighlighter, type XenoDiffHunk, type XenoDiffLine, type XenoDiffLineKind, type XenoDiffModel, type XenoDiffNavigate, type XenoDiffSegment, type XenoDiffStatus, type XenoDiffView, type XenoLogActivate, type XenoLogDelta, type XenoLogFilter, type XenoLogLevel, type XenoLogPatch, type XenoLogRecord, type XenoLogSource, type XenoRun, type XenoRunAction, type XenoRunActivate, type XenoRunDelta, type XenoRunError, type XenoRunFilter, type XenoRunLifecycle, type XenoRunPath, type XenoRunRow, type XenoRunRunRow, type XenoRunStats, type XenoRunStatus, type XenoRunStep, type XenoRunStepAppend, type XenoRunStepPatch, type XenoRunStepRow, type XenoRunTruncation, type XenoTerminalData, type XenoTerminalEmulator, type XenoTerminalId, type XenoTerminalIntent, type XenoTerminalSession, type XenoTerminalStatus, type XenoTerminalTheme, appendStepsAtPath, canCancel, canRetry, collapseAdjacent, computeStats, consoleManifest, consolePanel, countChanges, createConsolePanel, createDiffPanel, createRunsPanel, createTerminalPanel, decodeRunPath, diffManifest, diffPanel, durationOf, encodeRunPath, flattenHunks, flattenRunRows, formatDuration, formatRecord, isActive, isLive, isSettled, isTerminal, isWaiting, lifecycleOf, matchesSearch as matchesRunSearch, matchesSearch$1 as matchesSearch, measuredSize, meetsLevel, needsAttention, omissionLabel, patchStepAtPath, queueDurationOf, readTerminalTheme, resolveStepPath, runsManifest, runsPanel, safeJson, spliceRedactedAppend, splitRows, statusLabel, terminalManifest, terminalPanel, terminalThemeVar, truncateLogMessage };
2345
+ export { ALL_STATUSES, BEHAVIOURS as CONSOLE_BEHAVIOURS, CONSOLE_DECLARATION, CONSOLE_PANEL_ID, CONSOLE_RUNTIME_UNITS, ConsoleController, type ConsoleControllerOptions, type ConsoleHostBridge, type ConsolePanelState, ConsolePanelView, type ConsolePanelViewProps, type ConsoleRenderContext, ConsoleScroller, type ConsoleUiIntent, type ConsoleViewModel, type ConsoleViewOptions, type ConsoleViewRow, type ConsoleViewSource, type ConsoleViewState, type CreateConsolePanelOptions, type CreateDiffPanelOptions, type CreateRunsPanelOptions, type CreateTerminalPanelOptions, DEFAULT_MAX_STEP_DEPTH, DIFF_PANEL_ID, DiffController, type DiffControllerOptions, type DiffFileView, type DiffHostBridge, type DiffPanelState, DiffPanelView, type DiffPanelViewProps, type DiffRenderContext, type DiffViewState, type FlattenOptions, LEVEL_ORDER, MESSAGE_ELISION, REDACTION_CARRY, RUNS_PANEL_ID, RUN_PATH_SEPARATOR, RUN_STATUSES, RunsController, type RunsControllerOptions, type RunsHostBridge, type RunsPanelState, RunsPanelView, type RunsPanelViewProps, type RunsRenderContext, type RunsViewState, TERMINAL_PANEL_ID, TERMINAL_STATUSES, TerminalController, type TerminalControllerOptions, type TerminalHostBridge, type TerminalInstanceView, type TerminalPanelState, TerminalPanelView, type TerminalPanelViewProps, type TerminalRenderContext, type TerminalViewState, XENO_TERMINAL_THEME_KEYS, type XenoDiffAction, type XenoDiffDecision, type XenoDiffDecisionIntent, type XenoDiffDecisionState, type XenoDiffFile, type XenoDiffFileOmission, type XenoDiffHighlighter, type XenoDiffHunk, type XenoDiffLine, type XenoDiffLineKind, type XenoDiffModel, type XenoDiffNavigate, type XenoDiffSegment, type XenoDiffStatus, type XenoDiffView, type XenoLogActivate, type XenoLogDelta, type XenoLogFilter, type XenoLogLevel, type XenoLogPatch, type XenoLogRecord, type XenoLogSource, type XenoRun, type XenoRunAction, type XenoRunActivate, type XenoRunDelta, type XenoRunError, type XenoRunFilter, type XenoRunLifecycle, type XenoRunPath, type XenoRunRow, type XenoRunRunRow, type XenoRunStats, type XenoRunStatus, type XenoRunStep, type XenoRunStepAppend, type XenoRunStepPatch, type XenoRunStepRow, type XenoRunTruncation, type XenoTerminalData, type XenoTerminalEmulator, type XenoTerminalId, type XenoTerminalIntent, type XenoTerminalSession, type XenoTerminalStatus, type XenoTerminalTheme, appendStepsAtPath, applyConsoleUi, canCancel, canRetry, collapseAdjacent, computeStats, consoleManifest, consolePanel, consoleRuntimeComponents, consoleViewManifest, consoleViewState, countChanges, createConsolePanel, createDiffPanel, createRunsPanel, createTerminalPanel, decodeRunPath, diffManifest, diffPanel, durationOf, encodeRunPath, flattenHunks, flattenRunRows, formatDuration, formatRecord, isActive, isLive, isSettled, isTerminal, isWaiting, lifecycleOf, matchesSearch as matchesRunSearch, matchesSearch$1 as matchesSearch, measuredSize, meetsLevel, needsAttention, omissionLabel, patchStepAtPath, queueDurationOf, readTerminalTheme, resolveStepPath, runsManifest, runsPanel, safeJson, spliceRedactedAppend, splitRows, statusLabel, terminalManifest, terminalPanel, terminalThemeVar, truncateLogMessage };