@xenosystem/blocks 0.13.17 → 0.13.19

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.
@@ -2,7 +2,7 @@ import {
2
2
  ICONS,
3
3
  ICON_UNITS,
4
4
  Svg
5
- } from "../chunk-PI5WOATA.js";
5
+ } from "../chunk-7S2RKUAM.js";
6
6
  import "../chunk-2KG3PWR4.js";
7
7
  export {
8
8
  ICONS,
@@ -607,7 +607,7 @@ interface ConsoleViewOptions {
607
607
  declare function consoleViewState(c: ConsoleController, options?: ConsoleViewOptions): ConsoleViewModel;
608
608
  declare function applyConsoleUi(c: ConsoleController, intent: ConsoleUiIntent): void;
609
609
  declare const consoleViewManifest: PanelManifest;
610
- declare const BEHAVIOURS$1: {
610
+ declare const BEHAVIOURS$2: {
611
611
  'ops/consolePanelView': (inputs: Record<string, unknown>) => ConsoleViewModel;
612
612
  };
613
613
  /** The runtime-bound unit: the scroller the virtualizer measures and follow-mode pins. */
@@ -1518,7 +1518,7 @@ interface RunsViewOptions {
1518
1518
  declare function runsViewState(c: RunsController, options?: RunsViewOptions): RunsViewModel;
1519
1519
  declare function applyRunsUi(c: RunsController, intent: RunsUiIntent): void;
1520
1520
  declare const runsViewManifest: PanelManifest;
1521
- declare const BEHAVIOURS: {
1521
+ declare const BEHAVIOURS$1: {
1522
1522
  'ops/runsPanelView': (inputs: Record<string, unknown>) => RunsViewModel;
1523
1523
  };
1524
1524
  declare const RUNS_RUNTIME_UNITS: readonly [];
@@ -2424,24 +2424,173 @@ declare const DIFF_PANEL_ID = "xeno.core.diff";
2424
2424
  declare const diffManifest: PanelManifest;
2425
2425
 
2426
2426
  /**
2427
- * The Diff panel view.
2427
+ * The Diff panel AS A DECLARATION — the twentieth block written the §8d way.
2428
2428
  *
2429
- * **Where primitives fit and where they do not.** Toolbar, badges, section headers and the empty
2430
- * states are primitives. The diff body is not: a two-column, line-numbered, monospaced grid whose
2431
- * rows must align across both columns has no primitive, and the one thing it must never be is a
2432
- * `RowList` — those rows are variable-height and this grid's correctness depends on them not being.
2429
+ * Presentation contract: input `view` (a {@link DiffViewModel} the runtime derives from the
2430
+ * controller on every draw — the status decided, every file, hunk and line as DATA), output `ui`
2431
+ * (a {@link DiffUiIntent}) applied by the runtime to the controller's own methods.
2433
2432
  *
2434
- * @module
2433
+ * A file is a `chrome/Section` (collapsible, the status as its badge, the counts as its actions); a
2434
+ * hunk is a `chrome/Hunk` (focused by the cursor, settled once applied, the range and the decision
2435
+ * chip in its header, the review actions at its end); a line is a `chrome/DiffLine` whose text is
2436
+ * RUNS — the host's word-level marks when it computed them (they carry more information than a
2437
+ * token colour, and a prose diff has no tokens at all), else the highlighter's tokens, else plain —
2438
+ * with whitespace made visible here, in the model, when asked. Split view pairs lines in a
2439
+ * `chrome/DiffSplitRow` with a blank side. No runtime-bound unit.
2440
+ *
2441
+ * Three facts the model keeps distinct because a reviewer reads them differently: a comparison that
2442
+ * FAILED has established nothing (never "no changes"); a file OMITTED (binary, too large) was not
2443
+ * compared (never an empty body); a decision in CONFLICT is not one that failed (the file moved, so
2444
+ * it must be made again).
2435
2445
  */
2436
2446
 
2437
- /** Props for {@link DiffPanelView}. */
2438
- interface DiffPanelViewProps {
2439
- controller: DiffController;
2447
+ /** The half of a renderer's config the view reads. */
2448
+ interface DiffViewOptions {
2440
2449
  /** Optional syntax seam. No highlighter means plain text, never a missing panel. */
2441
2450
  highlighter?: XenoDiffHighlighter;
2451
+ /** Show the review actions. */
2442
2452
  review?: boolean;
2443
2453
  }
2454
+ interface DiffViewRun {
2455
+ text: string;
2456
+ mark?: 'insert' | 'delete';
2457
+ token?: string;
2458
+ }
2459
+ interface DiffViewLine {
2460
+ key: string;
2461
+ kind: 'added' | 'removed' | 'context' | 'blank';
2462
+ gutter: (number | string)[];
2463
+ sigil?: string;
2464
+ runs: DiffViewRun[];
2465
+ }
2466
+ interface DiffViewSplitRow {
2467
+ key: string;
2468
+ left: DiffViewLine;
2469
+ right: DiffViewLine;
2470
+ }
2471
+ interface DiffViewHunk {
2472
+ key: string;
2473
+ path: string;
2474
+ id: string;
2475
+ header: string;
2476
+ focused: boolean;
2477
+ settled: boolean;
2478
+ chipPending: boolean;
2479
+ chipConflict: boolean;
2480
+ conflictTitle: string;
2481
+ chipFailed: boolean;
2482
+ failedTitle?: string;
2483
+ chipApplied: boolean;
2484
+ appliedText: string;
2485
+ /** Review actions shown; `attention` swaps accept/reject for re-review. */
2486
+ review: boolean;
2487
+ attention: boolean;
2488
+ deciding: boolean;
2489
+ unified: boolean;
2490
+ split: boolean;
2491
+ lines: DiffViewLine[];
2492
+ rows: DiffViewSplitRow[];
2493
+ }
2494
+ interface DiffViewFile {
2495
+ key: string;
2496
+ path: string;
2497
+ title: string;
2498
+ status: string;
2499
+ counts: string;
2500
+ collapsed: boolean;
2501
+ omitted: boolean;
2502
+ omission: string;
2503
+ hunks: DiffViewHunk[];
2504
+ }
2505
+ interface DiffViewModel {
2506
+ idle: boolean;
2507
+ computing: boolean;
2508
+ failed: boolean;
2509
+ failedHint: string;
2510
+ identical: boolean;
2511
+ active: boolean;
2512
+ view: XenoDiffView;
2513
+ views: {
2514
+ label: string;
2515
+ value: XenoDiffView;
2516
+ }[];
2517
+ wrap: boolean;
2518
+ wrapLabel: string;
2519
+ whitespaceLabel: string;
2520
+ conflictNotice?: string;
2521
+ files: DiffViewFile[];
2522
+ countLabel: string;
2523
+ rightLabel: string;
2524
+ }
2525
+ type DiffUiIntent = {
2526
+ kind: 'view';
2527
+ view: XenoDiffView;
2528
+ } | {
2529
+ kind: 'toggleWrap';
2530
+ } | {
2531
+ kind: 'toggleWhitespace';
2532
+ } | {
2533
+ kind: 'prev';
2534
+ } | {
2535
+ kind: 'next';
2536
+ } | {
2537
+ kind: 'collapse';
2538
+ path: string;
2539
+ collapsed: boolean;
2540
+ } | {
2541
+ kind: 'contextMenu';
2542
+ path: string;
2543
+ id: string;
2544
+ x: number;
2545
+ y: number;
2546
+ } | {
2547
+ kind: 'decide';
2548
+ path: string;
2549
+ id: string;
2550
+ action: 'accept' | 'reject';
2551
+ } | {
2552
+ kind: 'reReview';
2553
+ path: string;
2554
+ id: string;
2555
+ };
2556
+ /** Derive the view model from the live controller — the runtime calls this on every draw. */
2557
+ declare function diffViewState(c: DiffController, options?: DiffViewOptions): DiffViewModel;
2558
+ /** Apply a `ui` intent to the controller — the runtime's half of the contract. */
2559
+ declare function applyDiffUi(c: DiffController, intent: DiffUiIntent): void;
2560
+ declare const diffViewManifest: PanelManifest;
2561
+ declare const BEHAVIOURS: {
2562
+ 'ops/diffPanelView': (inputs: Record<string, unknown>) => DiffViewModel;
2563
+ };
2564
+ declare const DIFF_DECLARATION: BlockDeclaration;
2565
+
2566
+ /**
2567
+ * The Diff panel view — the CODE VIEW of `DIFF_DECLARATION`, drawing the same {@link DiffViewModel}
2568
+ * byte-identical (the equivalence suite holds the two together). No runtime-bound unit; every
2569
+ * intent goes through `applyDiffUi`.
2570
+ *
2571
+ * Composes `@xenosystem/components/chrome` — a file is a `Section`, a hunk a `Hunk`, a line a
2572
+ * `DiffLine` of runs; the host must ensure `@xenosystem/workbench/primitives.css` is present.
2573
+ *
2574
+ * @module
2575
+ */
2576
+
2577
+ /** Props for {@link DiffPanelView}. */
2578
+ interface DiffPanelViewProps extends DiffViewOptions {
2579
+ controller: DiffController;
2580
+ }
2444
2581
  /** The Diff panel view. */
2445
- declare function DiffPanelView({ controller, highlighter, review }: DiffPanelViewProps): ReactNode;
2582
+ declare function DiffPanelView({ controller, ...options }: DiffPanelViewProps): ReactNode;
2583
+
2584
+ /**
2585
+ * `@xenosystem/blocks/ops` — the canonical XENO Diff panel (`xeno.core.diff`).
2586
+ *
2587
+ * Renders a **host-computed** comparison and emits hunk decisions as intents. Bundles no diff
2588
+ * engine and no editor.
2589
+ *
2590
+ * @packageDocumentation
2591
+ */
2592
+
2593
+ /** The unit names the runtime supplies for this block — none; every unit is a chrome unit. */
2594
+ declare const DIFF_RUNTIME_UNITS: readonly [];
2446
2595
 
2447
- export { ALL_STATUSES, BEHAVIOURS$1 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, BEHAVIOURS as RUNS_BEHAVIOURS, RUNS_DECLARATION, RUNS_PANEL_ID, RUNS_RUNTIME_UNITS, RUN_PATH_SEPARATOR, RUN_STATUSES, RunsController, type RunsControllerOptions, type RunsHostBridge, type RunsPanelState, RunsPanelView, type RunsPanelViewProps, type RunsRenderContext, type RunsUiIntent, type RunsViewChip, type RunsViewModel, type RunsViewOptions, type RunsViewRow, 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, applyRunsUi, 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, runsViewManifest, runsViewState, safeJson, spliceRedactedAppend, splitRows, statusLabel, terminalManifest, terminalPanel, terminalThemeVar, toneOf, truncateLogMessage };
2596
+ export { ALL_STATUSES, BEHAVIOURS$2 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, BEHAVIOURS as DIFF_BEHAVIOURS, DIFF_DECLARATION, DIFF_PANEL_ID, DIFF_RUNTIME_UNITS, DiffController, type DiffControllerOptions, type DiffFileView, type DiffHostBridge, type DiffPanelState, DiffPanelView, type DiffPanelViewProps, type DiffRenderContext, type DiffUiIntent, type DiffViewFile, type DiffViewHunk, type DiffViewLine, type DiffViewModel, type DiffViewOptions, type DiffViewRun, type DiffViewSplitRow, type DiffViewState, type FlattenOptions, LEVEL_ORDER, MESSAGE_ELISION, REDACTION_CARRY, BEHAVIOURS$1 as RUNS_BEHAVIOURS, RUNS_DECLARATION, RUNS_PANEL_ID, RUNS_RUNTIME_UNITS, RUN_PATH_SEPARATOR, RUN_STATUSES, RunsController, type RunsControllerOptions, type RunsHostBridge, type RunsPanelState, RunsPanelView, type RunsPanelViewProps, type RunsRenderContext, type RunsUiIntent, type RunsViewChip, type RunsViewModel, type RunsViewOptions, type RunsViewRow, 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, applyDiffUi, applyRunsUi, canCancel, canRetry, collapseAdjacent, computeStats, consoleManifest, consolePanel, consoleRuntimeComponents, consoleViewManifest, consoleViewState, countChanges, createConsolePanel, createDiffPanel, createRunsPanel, createTerminalPanel, decodeRunPath, diffManifest, diffPanel, diffViewManifest, diffViewState, 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, runsViewManifest, runsViewState, safeJson, spliceRedactedAppend, splitRows, statusLabel, terminalManifest, terminalPanel, terminalThemeVar, toneOf, truncateLogMessage };