@snackbit/opendil 0.0.0 → 0.1.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.
Files changed (105) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +200 -2
  3. package/THIRD_PARTY_NOTICES.md +9 -0
  4. package/bin/opendil.mjs +20 -0
  5. package/bin/publish-directory.mjs +32 -0
  6. package/dist/chunk-ZWAN2JCV.js +2 -0
  7. package/dist/index.js +11 -0
  8. package/dist/mermaid-diagram-GFWD4Y2X.js +2 -0
  9. package/dist/runtime/frame.html +2362 -0
  10. package/dist/runtime/frame.js +4625 -0
  11. package/dist/runtime/vm.js +6 -0
  12. package/dist/shadow-renderer-F25KL3C4.js +2363 -0
  13. package/dist/styles.css +2361 -0
  14. package/dist/types/components/ui/controls/button.d.ts +10 -0
  15. package/dist/types/components/ui/controls/checkbox.d.ts +4 -0
  16. package/dist/types/components/ui/controls/input.d.ts +3 -0
  17. package/dist/types/components/ui/controls/radio-group.d.ts +5 -0
  18. package/dist/types/components/ui/controls/slider.d.ts +4 -0
  19. package/dist/types/components/ui/controls/textarea.d.ts +3 -0
  20. package/dist/types/components/ui/controls/toggle-group.d.ts +9 -0
  21. package/dist/types/components/ui/controls/toggle.d.ts +9 -0
  22. package/dist/types/components/ui/display/badge.d.ts +9 -0
  23. package/dist/types/components/ui/display/card.d.ts +9 -0
  24. package/dist/types/components/ui/display/chart.d.ts +45 -0
  25. package/dist/types/components/ui/display/separator.d.ts +4 -0
  26. package/dist/types/components/ui/display/skeleton.d.ts +2 -0
  27. package/dist/types/components/ui/display/table.d.ts +10 -0
  28. package/dist/types/components/ui/media/carousel.d.ts +19 -0
  29. package/dist/types/components/ui/overlays/popover.d.ts +10 -0
  30. package/dist/types/components/ui/overlays/tooltip.d.ts +8 -0
  31. package/dist/types/components/ui/overlays/ui-scope.d.ts +11 -0
  32. package/dist/types/dil/custom-component.d.ts +14 -0
  33. package/dist/types/dil/customization.d.ts +21 -0
  34. package/dist/types/dil/dil-renderer.d.ts +55 -0
  35. package/dist/types/dil/isolation/frame.d.ts +1 -0
  36. package/dist/types/dil/isolation/isolated-renderer.d.ts +22 -0
  37. package/dist/types/dil/isolation/shadow-renderer.d.ts +7 -0
  38. package/dist/types/dil/isolation/shadow-styles.d.ts +2 -0
  39. package/dist/types/dil/isolation/viewport-scroll.d.ts +6 -0
  40. package/dist/types/dil/isolation/vm-worker.d.ts +1 -0
  41. package/dist/types/dil/message-renderer.d.ts +16 -0
  42. package/dist/types/dil/parser/dil-parser.d.ts +33 -0
  43. package/dist/types/dil/parser/lexical.d.ts +16 -0
  44. package/dist/types/dil/parser/stream-worker.d.ts +1 -0
  45. package/dist/types/dil/parser/types.d.ts +32 -0
  46. package/dist/types/dil/renderer-environment.d.ts +22 -0
  47. package/dist/types/dil/renderer-handle.d.ts +4 -0
  48. package/dist/types/dil/runtime/action-receipt.d.ts +5 -0
  49. package/dist/types/dil/runtime/child-list.d.ts +8 -0
  50. package/dist/types/dil/runtime/document.d.ts +42 -0
  51. package/dist/types/dil/runtime/evaluation-cache.d.ts +24 -0
  52. package/dist/types/dil/runtime/execution-queue.d.ts +55 -0
  53. package/dist/types/dil/runtime/expressions.d.ts +59 -0
  54. package/dist/types/dil/runtime/markdown-stream.d.ts +17 -0
  55. package/dist/types/dil/runtime/presentation-history.d.ts +14 -0
  56. package/dist/types/dil/runtime/presentation-scheduler.d.ts +16 -0
  57. package/dist/types/dil/runtime/render-budget.d.ts +10 -0
  58. package/dist/types/dil/runtime/view-cost.d.ts +10 -0
  59. package/dist/types/dil/view/conditional-view.d.ts +12 -0
  60. package/dist/types/dil/view/loading-block.d.ts +7 -0
  61. package/dist/types/dil/view/markdown-node.d.ts +12 -0
  62. package/dist/types/dil/view/node-children.d.ts +13 -0
  63. package/dist/types/dil/view/node-view.d.ts +11 -0
  64. package/dist/types/dil/view/progressive-reveal.d.ts +6 -0
  65. package/dist/types/dil/view/render-boundary.d.ts +22 -0
  66. package/dist/types/dil/view/render-limit.d.ts +14 -0
  67. package/dist/types/dil/view/repeated-nodes.d.ts +15 -0
  68. package/dist/types/dil/view/reveal/controller.d.ts +25 -0
  69. package/dist/types/dil/view/reveal/presentation.d.ts +13 -0
  70. package/dist/types/dil/view/reveal-options.d.ts +11 -0
  71. package/dist/types/dil/view/scroll/controller.d.ts +28 -0
  72. package/dist/types/dil/view/scroll-options.d.ts +10 -0
  73. package/dist/types/dil/view/stream-follow.d.ts +8 -0
  74. package/dist/types/dil/view/table-context.d.ts +15 -0
  75. package/dist/types/dil/view/virtual-flow.d.ts +15 -0
  76. package/dist/types/dil/widgets/action-feedback.d.ts +11 -0
  77. package/dist/types/dil/widgets/async-image.d.ts +6 -0
  78. package/dist/types/dil/widgets/charts/chart-legend.d.ts +10 -0
  79. package/dist/types/dil/widgets/charts/chart-selection.d.ts +8 -0
  80. package/dist/types/dil/widgets/charts/chart-series.d.ts +11 -0
  81. package/dist/types/dil/widgets/charts/chart-snapping.d.ts +15 -0
  82. package/dist/types/dil/widgets/charts/dil-chart.d.ts +5 -0
  83. package/dist/types/dil/widgets/charts/snap-cursor.d.ts +16 -0
  84. package/dist/types/dil/widgets/charts/snap-tooltip.d.ts +10 -0
  85. package/dist/types/dil/widgets/code/code-editor.d.ts +9 -0
  86. package/dist/types/dil/widgets/code/highlighted-code.d.ts +25 -0
  87. package/dist/types/dil/widgets/code-block.d.ts +11 -0
  88. package/dist/types/dil/widgets/control-revision.d.ts +1 -0
  89. package/dist/types/dil/widgets/control-state.d.ts +8 -0
  90. package/dist/types/dil/widgets/controls.d.ts +25 -0
  91. package/dist/types/dil/widgets/graphs/graph-model.d.ts +13 -0
  92. package/dist/types/dil/widgets/graphs/node-graph.d.ts +6 -0
  93. package/dist/types/dil/widgets/graphs/service-node.d.ts +3 -0
  94. package/dist/types/dil/widgets/mermaid-diagram.d.ts +5 -0
  95. package/dist/types/dil/widgets/primitives/attribute-values.d.ts +12 -0
  96. package/dist/types/dil/widgets/primitives/primitive.d.ts +17 -0
  97. package/dist/types/dil/widgets/primitives/vocabulary.d.ts +5 -0
  98. package/dist/types/dil/widgets/use-control-value.d.ts +2 -0
  99. package/dist/types/index.d.ts +8 -0
  100. package/dist/types/lib/cn.d.ts +2 -0
  101. package/dist/types/ui.d.ts +8 -0
  102. package/dist/ui.js +2 -0
  103. package/package.json +74 -4
  104. package/styles/tailwind.css +391 -0
  105. package/styles/tokens.css +29 -0
@@ -0,0 +1,59 @@
1
+ import { PresentationScheduler } from "./presentation-scheduler";
2
+ import { type Scope } from "./evaluation-cache";
3
+ export type { Scope } from "./evaluation-cache";
4
+ export interface BindingState {
5
+ values: Record<string, unknown>;
6
+ versions: Record<string, number>;
7
+ catalog: number;
8
+ }
9
+ export declare class EvaluationPending extends Error {
10
+ constructor();
11
+ }
12
+ export declare class ExpressionEngine {
13
+ readonly events: EventTarget;
14
+ private readonly updates;
15
+ readonly store: import("zustand").StoreApi<BindingState>;
16
+ private worker;
17
+ private readonly cache;
18
+ private readonly queue;
19
+ private intent;
20
+ private failed;
21
+ private gestureUntil;
22
+ private handleRefs;
23
+ private released;
24
+ private pendingChanges;
25
+ private urgentKeys;
26
+ compilations: number;
27
+ get stopped(): boolean;
28
+ get stats(): {
29
+ cached: number;
30
+ handles: number;
31
+ inFlight: number;
32
+ evaluations: number;
33
+ queued: number;
34
+ mutations: number;
35
+ };
36
+ markGesture(): void;
37
+ constructor(events?: EventTarget, updates?: PresentationScheduler);
38
+ private reference;
39
+ private replaceHandles;
40
+ private retire;
41
+ private notify;
42
+ private fill;
43
+ private receive;
44
+ halt(reason: string, report?: boolean): void;
45
+ dispose(): void;
46
+ /** Committed views own demand; cancelled renders never enqueue worker work. */
47
+ retain(expressions: readonly string[], scope?: Scope): () => void;
48
+ read(source: string, scope?: Scope): unknown;
49
+ hasValue(source: string, scope?: Scope): boolean;
50
+ isFresh(source: string, scope?: Scope): boolean;
51
+ evaluate(source: string, scope?: Scope): unknown;
52
+ private check;
53
+ evaluationRevision(source: string | undefined, scope?: Scope): number;
54
+ signature(expressions: readonly string[], scope: Scope, state: BindingState): string;
55
+ declare(source: string): void;
56
+ private call;
57
+ private decode;
58
+ private revive;
59
+ }
@@ -0,0 +1,17 @@
1
+ export interface MarkdownBlock {
2
+ offset: number;
3
+ text: string;
4
+ }
5
+ export interface MarkdownSnapshot {
6
+ source: string;
7
+ offset: number;
8
+ blocks: readonly MarkdownBlock[];
9
+ complete: boolean;
10
+ trailing?: MarkdownBlock;
11
+ }
12
+ export declare const EMPTY_MARKDOWN: MarkdownSnapshot;
13
+ /** Only the trailing block is reparsed; completed blocks keep their values and keys. */
14
+ export declare function advanceMarkdown(previous: MarkdownSnapshot, source: string, complete: boolean): MarkdownSnapshot;
15
+ export declare function currentMarkdown(snapshot: MarkdownSnapshot): readonly MarkdownBlock[];
16
+ export declare function markdownIndent(source: string): number | undefined;
17
+ export declare function normalizeMarkdown(source: string, indentation: number): string;
@@ -0,0 +1,14 @@
1
+ export type PresentationPhase = "ready" | "revealing" | "visible";
2
+ /** Logical message state survives view replacement and virtualization. */
3
+ export declare class PresentationHistory {
4
+ private phases;
5
+ private attributes;
6
+ private virtual;
7
+ phase(key: string): PresentationPhase | undefined;
8
+ set(key: string, phase: PresentationPhase): void;
9
+ last(key: string): Record<string, unknown> | undefined;
10
+ remember(key: string, value: Record<string, unknown>): void;
11
+ visited(key: string): boolean;
12
+ visit(key: string): void;
13
+ forget(prefix: string): void;
14
+ }
@@ -0,0 +1,16 @@
1
+ export type UpdateInterval = "instant" | number;
2
+ export declare function parseUpdateInterval(value: unknown): UpdateInterval;
3
+ /** Latest work per owner, bounded by cadence rather than waiting for a quiet stream. */
4
+ export declare class PresentationScheduler {
5
+ private pending;
6
+ private timer;
7
+ private last;
8
+ private interval;
9
+ private disposed;
10
+ configure(value: UpdateInterval): void;
11
+ enqueue(key: string, task: () => void, urgent?: boolean): void;
12
+ cancel(key: string): void;
13
+ private schedule;
14
+ private flush;
15
+ dispose(): void;
16
+ }
@@ -0,0 +1,10 @@
1
+ /** Bounds mounted presentation work, including multiplicative repeated templates. */
2
+ export declare class RenderBudget {
3
+ readonly limit: number;
4
+ private leases;
5
+ private total;
6
+ constructor(limit?: number);
7
+ get used(): number;
8
+ reserve(id: string, cost: number): boolean;
9
+ release(id: string): void;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { DilDocument } from "./document";
2
+ import type { Scope } from "./expressions";
3
+ export interface CostDocument {
4
+ nodes: DilDocument["nodes"];
5
+ engine: Pick<DilDocument["engine"], "read">;
6
+ attributes: DilDocument["attributes"];
7
+ }
8
+ /** Pure, short-circuiting preflight; unresolved expressions cost a local placeholder. */
9
+ export declare function nodeCost(document: CostDocument, id: number, scope: Scope, svg: boolean, limit: number): number;
10
+ export declare function childrenCost(document: CostDocument, ids: readonly number[], scope: Scope, svg: boolean, limit: number): number;
@@ -0,0 +1,12 @@
1
+ import type { ChildList } from "../runtime/child-list";
2
+ import type { DilDocument } from "../runtime/document";
3
+ import type { Scope } from "../runtime/expressions";
4
+ export interface ConditionalViewProps {
5
+ childrenIds: ChildList;
6
+ document: DilDocument;
7
+ scope: Scope;
8
+ svg: boolean;
9
+ inline: boolean;
10
+ instance: string;
11
+ }
12
+ export declare function ConditionalView({ childrenIds, document, scope, svg, inline, instance, }: ConditionalViewProps): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ export interface LoadingBlockProps {
2
+ name?: string;
3
+ table?: false | "body" | "row";
4
+ svg?: boolean;
5
+ error?: string | undefined;
6
+ }
7
+ export declare function LoadingBlock({ name: _name, table, svg, error, }: LoadingBlockProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type Scope } from "../runtime/expressions";
2
+ import type { DilNode } from "../parser/types";
3
+ import type { DilDocument } from "../runtime/document";
4
+ export interface MarkdownNodeProps {
5
+ node: DilNode;
6
+ document: DilDocument;
7
+ scope: Scope;
8
+ inline: boolean;
9
+ svg: boolean;
10
+ instance: string;
11
+ }
12
+ export declare function MarkdownNode({ node, document, scope, inline, svg, instance, }: MarkdownNodeProps): import("react").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import type { DilDocument } from "../runtime/document";
2
+ import type { Scope } from "../runtime/expressions";
3
+ import type { ChildList } from "../runtime/child-list";
4
+ export interface NodeChildrenProps {
5
+ childrenIds: ChildList;
6
+ document: DilDocument;
7
+ scope: Scope;
8
+ inline: boolean;
9
+ svg: boolean;
10
+ instance: string;
11
+ flowParent?: number | undefined;
12
+ }
13
+ export declare function NodeChildren({ childrenIds, document, scope, inline, svg, instance, flowParent, }: NodeChildrenProps): import("react").JSX.Element | import("react").JSX.Element[];
@@ -0,0 +1,11 @@
1
+ import type { DilDocument } from "../runtime/document";
2
+ import type { Scope } from "../runtime/expressions";
3
+ export interface NodeViewProps {
4
+ id: number;
5
+ document: DilDocument;
6
+ scope?: Scope;
7
+ inline?: boolean;
8
+ svg?: boolean;
9
+ instance?: string;
10
+ }
11
+ export declare const NodeView: import("react").NamedExoticComponent<NodeViewProps>;
@@ -0,0 +1,6 @@
1
+ import { type RefObject } from "react";
2
+ import type { DilDocument } from "../runtime/document";
3
+ import { type ProgressiveReveal } from "./reveal-options";
4
+ import { RevealController } from "./reveal/controller";
5
+ export declare function revealDelay(index: number, staggerMs?: number): number;
6
+ export declare function useProgressiveReveal(root: RefObject<HTMLElement | null>, options: ProgressiveReveal, document: DilDocument | null): RevealController;
@@ -0,0 +1,22 @@
1
+ import { Component, type ReactNode } from "react";
2
+ interface RenderBoundaryProps {
3
+ revision: string;
4
+ streaming: boolean;
5
+ children: ReactNode;
6
+ }
7
+ interface BoundaryState {
8
+ error: string;
9
+ revision: string;
10
+ }
11
+ export declare class RenderBoundary extends Component<RenderBoundaryProps, BoundaryState> {
12
+ state: BoundaryState;
13
+ static getDerivedStateFromProps(props: RenderBoundaryProps, state: BoundaryState): {
14
+ revision: string;
15
+ error: string;
16
+ } | null;
17
+ static getDerivedStateFromError(error: unknown): {
18
+ error: string;
19
+ };
20
+ render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
21
+ }
22
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from "react";
2
+ import type { DilDocument } from "../runtime/document";
3
+ type BudgetDocument = Pick<DilDocument, "renderBudget" | "reportRenderLimit">;
4
+ export declare const RenderAllowance: import("react").Context<number>;
5
+ export interface RenderLimitProps {
6
+ document: BudgetDocument;
7
+ cost?: number;
8
+ children: ReactNode;
9
+ }
10
+ export declare function RenderExceeded({ document }: {
11
+ document: BudgetDocument;
12
+ }): null;
13
+ export declare function RenderLimit({ document, cost, children, }: RenderLimitProps): import("react").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { DilNode } from "../parser/types";
2
+ import type { ChildList } from "../runtime/child-list";
3
+ import type { DilDocument } from "../runtime/document";
4
+ import type { Scope } from "../runtime/expressions";
5
+ interface RepeatedNodesProps {
6
+ node: DilNode;
7
+ childrenIds: ChildList;
8
+ document: DilDocument;
9
+ scope: Scope;
10
+ svg: boolean;
11
+ instance: string;
12
+ attributes: Record<string, unknown>;
13
+ }
14
+ export declare function RepeatedNodes(props: RepeatedNodesProps): import("react").JSX.Element | import("react").JSX.Element[] | null;
15
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { PresentationHistory } from "../../runtime/presentation-history";
2
+ import type { RevealTiming } from "../reveal-options";
3
+ export declare class RevealController {
4
+ readonly history: PresentationHistory;
5
+ private readonly viewport;
6
+ private timing;
7
+ private targets;
8
+ private queued;
9
+ private frame;
10
+ private started;
11
+ private reduced;
12
+ private nextStart;
13
+ constructor(history: PresentationHistory, viewport: () => {
14
+ top: number;
15
+ bottom: number;
16
+ });
17
+ configure(timing: RevealTiming | null): void;
18
+ start(): () => void;
19
+ register(key: string, element: HTMLElement, eligible: boolean, skip: boolean): () => void;
20
+ private prepare;
21
+ private finish;
22
+ showAll(): void;
23
+ private schedule;
24
+ private flush;
25
+ }
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from "react";
2
+ import type { RevealController } from "./controller";
3
+ export declare const RevealContext: import("react").Context<RevealController | null>;
4
+ export declare function usePresentationKey(identity: string): string;
5
+ export declare function usePresentationTarget(identity: string, eligible?: boolean): (element: HTMLElement | null) => void;
6
+ export declare function VirtualPresentation({ identity, returning, children, }: {
7
+ identity: string;
8
+ returning: boolean;
9
+ children: ReactNode;
10
+ }): import("react").JSX.Element;
11
+ export declare function BranchPresentation({ children }: {
12
+ children: ReactNode;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export interface ProgressiveRevealOptions {
2
+ staggerMs?: number;
3
+ durationMs?: number;
4
+ }
5
+ export type ProgressiveReveal = boolean | ProgressiveRevealOptions;
6
+ export interface RevealTiming {
7
+ staggerMs: number;
8
+ durationMs: number;
9
+ }
10
+ export declare function revealTiming(value: ProgressiveReveal): RevealTiming | null;
11
+ export declare function readReveal(value: unknown): ProgressiveReveal;
@@ -0,0 +1,28 @@
1
+ import type { scrollSettings } from "../scroll-options";
2
+ type Settings = ReturnType<typeof scrollSettings>;
3
+ /** One moving-target animation per message. Native smooth scrolling would restart on each chunk. */
4
+ export declare class ScrollFollower {
5
+ private readonly element;
6
+ private readonly settings;
7
+ private readonly changed;
8
+ private readonly view;
9
+ private readonly reduced;
10
+ private readonly observer;
11
+ private readonly unlisten;
12
+ private releaseAnchor;
13
+ private frame;
14
+ private previous;
15
+ private position;
16
+ private following;
17
+ private notified;
18
+ constructor(element: HTMLElement, settings: () => Settings, changed: (following: boolean) => void, listen: (view: Window, pause: () => void) => () => void);
19
+ private report;
20
+ start(): void;
21
+ end(): void;
22
+ resume: () => void;
23
+ pause: () => void;
24
+ refresh: () => void;
25
+ private tick;
26
+ dispose(): void;
27
+ }
28
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface AutoScrollOptions {
2
+ behavior?: "instant" | "smooth";
3
+ /** Extra distance beyond the message tail, clamped to available document space. */
4
+ padding?: number;
5
+ }
6
+ export type AutoScroll = boolean | AutoScrollOptions;
7
+ export declare function scrollSettings(value: AutoScroll): {
8
+ behavior: "instant" | "smooth";
9
+ padding: number;
10
+ } | null;
@@ -0,0 +1,8 @@
1
+ import { type RefObject } from "react";
2
+ import { type AutoScroll } from "./scroll-options";
3
+ export declare function listenForScrollAway(view: Window, pause: () => void): () => void;
4
+ /** Only deliberate reading gestures suspend following, never layout or anchor adjustments. */
5
+ export declare function useStreamFollow(root: RefObject<HTMLElement | null>, options: AutoScroll, streaming: boolean, onChange?: ((following: boolean) => void) | undefined): {
6
+ pause: () => void | undefined;
7
+ resume: () => void | undefined;
8
+ };
@@ -0,0 +1,15 @@
1
+ import { type FocusEvent, type ReactNode } from "react";
2
+ export declare const TableScope: import("react").Context<false | "row" | "body">;
3
+ interface RowMeasurement {
4
+ index: number;
5
+ group: string;
6
+ measure: (element: HTMLElement | null) => void;
7
+ focus: (event: FocusEvent<HTMLElement>) => void;
8
+ blur: (event: FocusEvent<HTMLElement>) => void;
9
+ }
10
+ export declare const VirtualRowScope: import("react").Context<RowMeasurement | null>;
11
+ export declare function DilTableRow({ children, presentationRef, }: {
12
+ children: ReactNode;
13
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
14
+ }): import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ChildList } from "../runtime/child-list";
3
+ import type { DilDocument } from "../runtime/document";
4
+ import type { Scope } from "../runtime/expressions";
5
+ export interface VirtualFlowProps {
6
+ identity?: string;
7
+ count: number;
8
+ childIds?: ChildList;
9
+ document: DilDocument;
10
+ scope: Scope;
11
+ instance: string;
12
+ renderItem?: (index: number) => ReactNode;
13
+ itemKey?: (index: number) => string | number;
14
+ }
15
+ export declare function VirtualFlow({ identity, count, childIds, document, scope, instance, renderItem, itemKey, }: VirtualFlowProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StoreApi } from "zustand/vanilla";
3
+ import type { DocumentStatus } from "../runtime/document";
4
+ export type ActionFeedback = "idle" | "copied" | "failed";
5
+ /** Shows the clipboard outcome of the action this control started, briefly. */
6
+ export declare function useActionFeedback(status: StoreApi<DocumentStatus>): readonly [ActionFeedback, (result: unknown) => void];
7
+ /** Always mounted around the control so showing feedback never remounts or blurs it. */
8
+ export declare function ActionFeedbackTooltip({ feedback, children, }: {
9
+ feedback: ActionFeedback;
10
+ children: ReactNode;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface AsyncImageProps {
2
+ query: string;
3
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
4
+ }
5
+ /** Offline illustration. A host-mode component override can supply an image service. */
6
+ export declare function AsyncImage({ query, presentationRef }: AsyncImageProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { ChartItem } from "./chart-selection";
2
+ export interface ChartLegendProps {
3
+ items: readonly ChartItem[];
4
+ hidden: ReadonlySet<string>;
5
+ hovered: string | null;
6
+ select: (id: string, toggle: boolean) => void;
7
+ highlight: (id: string | null) => void;
8
+ interactive: boolean;
9
+ }
10
+ export declare function ChartLegend({ items, hidden, hovered, select, highlight, interactive, }: ChartLegendProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export interface ChartItem {
2
+ id: string;
3
+ label: string;
4
+ color: string;
5
+ }
6
+ /** Grafana: isolate on plain click, toggle individually with Ctrl/Cmd. */
7
+ export declare function selectChartItem(ids: readonly string[], hidden: ReadonlySet<string>, id: string, toggle: boolean): Set<string>;
8
+ export declare function reconcileChartSelection(ids: readonly string[], hidden: ReadonlySet<string>): Set<string>;
@@ -0,0 +1,11 @@
1
+ import type { ChartItem } from "./chart-selection";
2
+ export interface ChartSeriesProps {
3
+ item: ChartItem;
4
+ index: number;
5
+ type: string;
6
+ hidden: boolean;
7
+ muted: boolean;
8
+ rows: Record<string, unknown>[];
9
+ highlight: (id: string | null) => void;
10
+ }
11
+ export declare function ChartSeries({ item, index, type, hidden, muted, rows, highlight, }: ChartSeriesProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { ChartItem } from "./chart-selection";
2
+ export interface ChartPoint {
3
+ index: number;
4
+ item: ChartItem;
5
+ row: Record<string, unknown>;
6
+ x: number;
7
+ y: number;
8
+ value: number;
9
+ }
10
+ type AxisScale = (value: unknown, options?: {
11
+ position: "middle";
12
+ }) => number | undefined;
13
+ export declare function projectChartPoints(rows: Record<string, unknown>[], items: readonly ChartItem[], xKey: string, xScale: AxisScale, yScale: AxisScale): ChartPoint[];
14
+ export declare function nearestChartPoint(points: readonly ChartPoint[], x: number, y: number, scatter: boolean): ChartPoint | undefined;
15
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface DilChartProps {
2
+ content: unknown;
3
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
4
+ }
5
+ export declare function DilChart({ content, presentationRef }: DilChartProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type ChartPoint } from "./chart-snapping";
2
+ import type { ChartItem } from "./chart-selection";
3
+ export interface ChartHit {
4
+ point: ChartPoint;
5
+ clientX: number;
6
+ clientY: number;
7
+ }
8
+ export interface SnapCursorProps {
9
+ rows: Record<string, unknown>[];
10
+ items: readonly ChartItem[];
11
+ xKey: string;
12
+ scatter: boolean;
13
+ hit: ChartHit | null;
14
+ onHover: (hit: ChartHit | null) => void;
15
+ }
16
+ export declare function SnapCursor({ rows, items, xKey, scatter, hit, onHover, }: SnapCursorProps): import("react").JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import type { ChartItem } from "./chart-selection";
2
+ import type { ChartHit } from "./snap-cursor";
3
+ export interface SnapTooltipProps {
4
+ hit: ChartHit | null;
5
+ items: readonly ChartItem[];
6
+ xKey: string;
7
+ scatter: boolean;
8
+ onHover: (hit: ChartHit | null) => void;
9
+ }
10
+ export declare function SnapTooltip({ hit, items, xKey, scatter, onHover, }: SnapTooltipProps): import("react").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { type ChangeEvent } from "react";
2
+ export interface CodeEditorProps {
3
+ source: string;
4
+ language: string;
5
+ ready: boolean;
6
+ wrapped: boolean;
7
+ onChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;
8
+ }
9
+ export declare function CodeEditor({ source, language, ready, wrapped, onChange, }: CodeEditorProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from "react";
2
+ declare const highlighter: {
3
+ highlight: (language: string, value: string, options?: Readonly<import("lowlight").Options> | null | undefined) => import("hast").Root;
4
+ highlightAuto: (value: string, options?: Readonly<import("lowlight").AutoOptions> | null | undefined) => import("hast").Root;
5
+ listLanguages: () => Array<string>;
6
+ register: {
7
+ (grammars: Readonly<Record<string, import("highlight.js").LanguageFn>>): undefined;
8
+ (name: string, grammar: import("highlight.js").LanguageFn): undefined;
9
+ };
10
+ registerAlias: {
11
+ (aliases: Readonly<Record<string, ReadonlyArray<string> | string>>): undefined;
12
+ (language: string, alias: ReadonlyArray<string> | string): undefined;
13
+ };
14
+ registered: (aliasOrName: string) => boolean;
15
+ };
16
+ type Tree = ReturnType<typeof highlighter.highlight>;
17
+ export declare function renderTokens(node: Tree | Tree["children"][number], count: {
18
+ value: number;
19
+ }): ReactNode;
20
+ /** Highlight AST nodes become React text/spans; authored code never becomes raw HTML. */
21
+ export declare const HighlightedCode: import("react").NamedExoticComponent<{
22
+ source: string;
23
+ language: string;
24
+ }>;
25
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { DilDocument } from "../runtime/document";
2
+ export interface CodeBlockProps {
3
+ source: string;
4
+ language: string;
5
+ editable: boolean;
6
+ ready: boolean;
7
+ document: DilDocument;
8
+ identity: string;
9
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
10
+ }
11
+ export declare function CodeBlock({ source, language, editable, ready, document, identity, presentationRef, }: CodeBlockProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const ControlRevisionContext: import("react").Context<number>;
@@ -0,0 +1,8 @@
1
+ export interface ControlDraft<T> {
2
+ upstream: T;
3
+ value: T;
4
+ revision: number;
5
+ pending: number;
6
+ }
7
+ export declare function synchronizeDraft<T>(state: ControlDraft<T>, upstream: T, revision: number): ControlDraft<T>;
8
+ export declare function editDraft<T>(state: ControlDraft<T>, value: T, result: unknown, commit: boolean): ControlDraft<T>;
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StoreApi } from "zustand/vanilla";
3
+ import type { DocumentStatus } from "../runtime/document";
4
+ import { type Attributes } from "./primitives/attribute-values";
5
+ export declare const PopoverTriggerScope: import("react").Context<boolean>;
6
+ export interface ControlProps {
7
+ attributes: Attributes;
8
+ children?: ReactNode;
9
+ ready: boolean;
10
+ label: string;
11
+ className?: string | undefined;
12
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
13
+ }
14
+ /** Actions report clipboard outcomes from their own document. */
15
+ export interface ActionProps extends ControlProps {
16
+ status: StoreApi<DocumentStatus>;
17
+ }
18
+ export declare function ButtonControl({ attributes, children, ready, label, className, presentationRef, status, }: ActionProps): import("react").JSX.Element;
19
+ export declare function CheckboxControl({ attributes, children, ready, className, presentationRef, }: ControlProps): import("react").JSX.Element;
20
+ export declare function SliderControl({ attributes, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
21
+ export declare function InputControl({ attributes, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
22
+ export declare function SegmentedControl({ attributes, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
23
+ export declare function RadioGroupControl({ attributes, children, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
24
+ export declare function RadioControl({ attributes, children, ready, className, presentationRef, }: ControlProps): import("react").JSX.Element;
25
+ export declare function PressableControl({ attributes, children, ready, className, presentationRef, status, }: ActionProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type Edge, type Node } from "@xyflow/react";
2
+ export declare const SERVICE_WIDTH = 160;
3
+ export declare const SERVICE_HEIGHT = 72;
4
+ export declare const COLUMN_GAP = 64;
5
+ export type ServiceData = {
6
+ label: string;
7
+ sub: string;
8
+ };
9
+ export type ServiceGraphNode = Node<ServiceData, "service">;
10
+ export declare function graphModel(content: unknown): {
11
+ nodes: ServiceGraphNode[];
12
+ edges: Edge[];
13
+ };
@@ -0,0 +1,6 @@
1
+ import { type Attributes } from "../primitives/attribute-values";
2
+ export interface NodeGraphProps {
3
+ attributes: Attributes;
4
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
5
+ }
6
+ export declare function NodeGraph({ attributes, presentationRef }: NodeGraphProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type NodeProps } from "@xyflow/react";
2
+ import type { ServiceGraphNode } from "./graph-model";
3
+ export declare function ServiceNode({ data, selected }: NodeProps<ServiceGraphNode>): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface MermaidDiagramProps {
2
+ source: string;
3
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
4
+ }
5
+ export declare function MermaidDiagram({ source, presentationRef, }: MermaidDiagramProps): import("react").JSX.Element | null;