@snackbit/opendil 0.0.0 → 0.2.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/LICENSE +201 -0
- package/README.md +137 -2
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/bin/opendil.mjs +75 -0
- package/bin/publish-directory.d.mts +18 -0
- package/bin/publish-directory.mjs +188 -0
- package/dist/agent-spec.js +9 -0
- package/dist/chunk-RPZW4WVX.js +2 -0
- package/dist/chunk-ZSTXLIS6.js +2 -0
- package/dist/index.js +2 -0
- package/dist/mermaid-diagram-GFWD4Y2X.js +2 -0
- package/dist/runtime/frame.html +2435 -0
- package/dist/runtime/frame.js +4621 -0
- package/dist/spec/genui.agent.full.md +1927 -0
- package/dist/spec/genui.agent.md +479 -0
- package/dist/spec/genui.examples.md +836 -0
- package/dist/styled-renderer-PHI4MNPF.js +2441 -0
- package/dist/styles.css +2434 -0
- package/dist/types/agent-spec.d.ts +12 -0
- package/dist/types/components/ui/controls/button.d.ts +10 -0
- package/dist/types/components/ui/controls/checkbox.d.ts +4 -0
- package/dist/types/components/ui/controls/input.d.ts +3 -0
- package/dist/types/components/ui/controls/radio-group.d.ts +5 -0
- package/dist/types/components/ui/controls/select.d.ts +14 -0
- package/dist/types/components/ui/controls/slider.d.ts +4 -0
- package/dist/types/components/ui/controls/tabs.d.ts +7 -0
- package/dist/types/components/ui/controls/textarea.d.ts +3 -0
- package/dist/types/components/ui/controls/toggle-group.d.ts +10 -0
- package/dist/types/components/ui/controls/toggle.d.ts +9 -0
- package/dist/types/components/ui/display/badge.d.ts +9 -0
- package/dist/types/components/ui/display/card.d.ts +9 -0
- package/dist/types/components/ui/display/chart.d.ts +39 -0
- package/dist/types/components/ui/display/separator.d.ts +4 -0
- package/dist/types/components/ui/display/skeleton.d.ts +2 -0
- package/dist/types/components/ui/display/table.d.ts +10 -0
- package/dist/types/components/ui/media/carousel.d.ts +19 -0
- package/dist/types/components/ui/overlays/collapsible.d.ts +6 -0
- package/dist/types/components/ui/overlays/popover.d.ts +11 -0
- package/dist/types/components/ui/overlays/tooltip.d.ts +8 -0
- package/dist/types/components/ui/overlays/ui-scope.d.ts +27 -0
- package/dist/types/dil/custom-component.d.ts +14 -0
- package/dist/types/dil/customization.d.ts +21 -0
- package/dist/types/dil/dil-renderer.d.ts +90 -0
- package/dist/types/dil/isolation/frame-startup.d.ts +18 -0
- package/dist/types/dil/isolation/frame-theme.d.ts +14 -0
- package/dist/types/dil/isolation/frame-viewport.d.ts +30 -0
- package/dist/types/dil/isolation/frame.d.ts +1 -0
- package/dist/types/dil/isolation/isolated-renderer.d.ts +28 -0
- package/dist/types/dil/isolation/overlay-room.d.ts +29 -0
- package/dist/types/dil/isolation/shadow-renderer.d.ts +7 -0
- package/dist/types/dil/isolation/shadow-styles.d.ts +2 -0
- package/dist/types/dil/isolation/viewport-scroll.d.ts +7 -0
- package/dist/types/dil/isolation/vm-worker.d.ts +1 -0
- package/dist/types/dil/message-renderer.d.ts +17 -0
- package/dist/types/dil/parser/dil-parser.d.ts +74 -0
- package/dist/types/dil/parser/lexical.d.ts +27 -0
- package/dist/types/dil/parser/literal-tag.d.ts +16 -0
- package/dist/types/dil/parser/markdown-lexing.d.ts +41 -0
- package/dist/types/dil/parser/stream-worker.d.ts +1 -0
- package/dist/types/dil/parser/types.d.ts +53 -0
- package/dist/types/dil/parser/unfinished.d.ts +22 -0
- package/dist/types/dil/parser/vocabulary.d.ts +12 -0
- package/dist/types/dil/render-error.d.ts +47 -0
- package/dist/types/dil/renderer-environment.d.ts +33 -0
- package/dist/types/dil/renderer-handle.d.ts +4 -0
- package/dist/types/dil/runtime/action-receipt.d.ts +5 -0
- package/dist/types/dil/runtime/child-list.d.ts +8 -0
- package/dist/types/dil/runtime/document.d.ts +54 -0
- package/dist/types/dil/runtime/evaluation-cache.d.ts +24 -0
- package/dist/types/dil/runtime/execution-queue.d.ts +56 -0
- package/dist/types/dil/runtime/expressions.d.ts +62 -0
- package/dist/types/dil/runtime/inline-worker.d.ts +33 -0
- package/dist/types/dil/runtime/markdown-stream.d.ts +17 -0
- package/dist/types/dil/runtime/presentation-history.d.ts +14 -0
- package/dist/types/dil/runtime/presentation-scheduler.d.ts +16 -0
- package/dist/types/dil/runtime/render-budget.d.ts +10 -0
- package/dist/types/dil/runtime/view-cost.d.ts +10 -0
- package/dist/types/dil/styled-renderer.d.ts +39 -0
- package/dist/types/dil/view/conditional-view.d.ts +12 -0
- package/dist/types/dil/view/loading-block.d.ts +7 -0
- package/dist/types/dil/view/markdown-node.d.ts +12 -0
- package/dist/types/dil/view/node-children.d.ts +13 -0
- package/dist/types/dil/view/node-view.d.ts +11 -0
- package/dist/types/dil/view/progressive-reveal.d.ts +7 -0
- package/dist/types/dil/view/render-boundary.d.ts +35 -0
- package/dist/types/dil/view/render-limit.d.ts +14 -0
- package/dist/types/dil/view/repeated-nodes.d.ts +15 -0
- package/dist/types/dil/view/reveal/controller.d.ts +32 -0
- package/dist/types/dil/view/reveal/presentation.d.ts +13 -0
- package/dist/types/dil/view/reveal-options.d.ts +11 -0
- package/dist/types/dil/view/scroll/controller.d.ts +42 -0
- package/dist/types/dil/view/scroll/host-viewport.d.ts +24 -0
- package/dist/types/dil/view/scroll/root-tracker.d.ts +17 -0
- package/dist/types/dil/view/scroll/scroll-root.d.ts +36 -0
- package/dist/types/dil/view/scroll-options.d.ts +25 -0
- package/dist/types/dil/view/stream-follow.d.ts +15 -0
- package/dist/types/dil/view/table-context.d.ts +15 -0
- package/dist/types/dil/view/virtual-flow.d.ts +15 -0
- package/dist/types/dil/widgets/action-feedback.d.ts +11 -0
- package/dist/types/dil/widgets/async-image.d.ts +6 -0
- package/dist/types/dil/widgets/charts/chart-hover.d.ts +17 -0
- package/dist/types/dil/widgets/charts/chart-legend.d.ts +10 -0
- package/dist/types/dil/widgets/charts/chart-pie.d.ts +16 -0
- package/dist/types/dil/widgets/charts/chart-selection.d.ts +8 -0
- package/dist/types/dil/widgets/charts/chart-series.d.ts +19 -0
- package/dist/types/dil/widgets/charts/chart-snapping.d.ts +13 -0
- package/dist/types/dil/widgets/charts/dil-chart.d.ts +5 -0
- package/dist/types/dil/widgets/charts/snap-cursor.d.ts +12 -0
- package/dist/types/dil/widgets/charts/snap-tooltip.d.ts +12 -0
- package/dist/types/dil/widgets/code/code-editor.d.ts +9 -0
- package/dist/types/dil/widgets/code/highlighted-code.d.ts +25 -0
- package/dist/types/dil/widgets/code-block.d.ts +11 -0
- package/dist/types/dil/widgets/control-revision.d.ts +1 -0
- package/dist/types/dil/widgets/control-state.d.ts +8 -0
- package/dist/types/dil/widgets/controls.d.ts +25 -0
- package/dist/types/dil/widgets/graphs/graph-model.d.ts +13 -0
- package/dist/types/dil/widgets/graphs/node-graph.d.ts +6 -0
- package/dist/types/dil/widgets/graphs/service-node.d.ts +3 -0
- package/dist/types/dil/widgets/mermaid-diagram.d.ts +5 -0
- package/dist/types/dil/widgets/primitives/attribute-values.d.ts +12 -0
- package/dist/types/dil/widgets/primitives/primitive.d.ts +17 -0
- package/dist/types/dil/widgets/primitives/vocabulary.d.ts +5 -0
- package/dist/types/dil/widgets/use-control-value.d.ts +2 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/lib/cn.d.ts +2 -0
- package/dist/types/ui.d.ts +11 -0
- package/dist/ui.js +2 -0
- package/package.json +85 -4
- package/styles/tailwind.css +443 -0
- package/styles/tokens.css +32 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primary DIL authoring instructions (genui.agent.md). Put this in the system
|
|
3
|
+
* prompt of the model that writes documents for this renderer version.
|
|
4
|
+
*/
|
|
5
|
+
export declare const agentSpec: string;
|
|
6
|
+
/**
|
|
7
|
+
* Complete component and property reference (genui.agent.full.md) for
|
|
8
|
+
* targeted lookups, such as a retrieval tool or a larger context budget.
|
|
9
|
+
*/
|
|
10
|
+
export declare const agentSpecFull: string;
|
|
11
|
+
/** Executable example catalog (genui.examples.md) with recipes per feature. */
|
|
12
|
+
export declare const agentSpecExamples: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
3
|
+
declare const Select: import("react").FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectValue: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const SelectViewport: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectViewportProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const SelectItemIndicator: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
declare const SelectItemText: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectItemTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
declare function SelectPortal(props: ComponentProps<typeof SelectPrimitive.Portal>): import("react").JSX.Element;
|
|
10
|
+
declare function SelectTrigger({ className, ...props }: ComponentProps<typeof SelectPrimitive.Trigger>): import("react").JSX.Element;
|
|
11
|
+
declare function SelectContent({ className, ...props }: ComponentProps<typeof SelectPrimitive.Content>): import("react").JSX.Element;
|
|
12
|
+
declare function SelectItem({ className, ...props }: ComponentProps<typeof SelectPrimitive.Item>): import("react").JSX.Element;
|
|
13
|
+
declare function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>): import("react").JSX.Element;
|
|
14
|
+
export { Select, SelectValue, SelectGroup, SelectPortal, SelectViewport, SelectItemIndicator, SelectItemText, SelectTrigger, SelectContent, SelectItem, SelectLabel, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
3
|
+
declare function Tabs(props: ComponentProps<typeof TabsPrimitive.Root>): import("react").JSX.Element;
|
|
4
|
+
declare function TabsList({ className, ...props }: ComponentProps<typeof TabsPrimitive.List>): import("react").JSX.Element;
|
|
5
|
+
declare function TabsTrigger({ className, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>): import("react").JSX.Element;
|
|
6
|
+
declare function TabsContent(props: ComponentProps<typeof TabsPrimitive.Content>): import("react").JSX.Element;
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
4
|
+
import { toggleVariants } from "./toggle.js";
|
|
5
|
+
declare function ToggleGroup({ className, variant, size, spacing, segmented, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
6
|
+
spacing?: number;
|
|
7
|
+
segmented?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
10
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Toggle as TogglePrimitive } from "radix-ui";
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
9
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RechartsPrimitive from "recharts";
|
|
3
|
+
import type { TooltipValueType } from "recharts";
|
|
4
|
+
type TooltipNameType = number | string;
|
|
5
|
+
export type ChartConfig = Record<string, {
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
icon?: React.ComponentType;
|
|
8
|
+
} & ({
|
|
9
|
+
color?: string;
|
|
10
|
+
theme?: never;
|
|
11
|
+
} | {
|
|
12
|
+
color?: never;
|
|
13
|
+
theme: Record<"light" | "dark", string>;
|
|
14
|
+
})>;
|
|
15
|
+
declare function ChartContainer({ id, className, children, config, overlay, initialDimension, style, ...props }: React.ComponentProps<"div"> & {
|
|
16
|
+
config: ChartConfig;
|
|
17
|
+
overlay?: React.ReactNode;
|
|
18
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
19
|
+
initialDimension?: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
25
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, emphasizedKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
|
26
|
+
hideLabel?: boolean;
|
|
27
|
+
hideIndicator?: boolean;
|
|
28
|
+
indicator?: "line" | "dot" | "dashed";
|
|
29
|
+
nameKey?: string;
|
|
30
|
+
labelKey?: string;
|
|
31
|
+
/** Marks the row whose dataKey matches with `data-emphasized="true"` for styling. */
|
|
32
|
+
emphasizedKey?: string | undefined;
|
|
33
|
+
} & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): React.JSX.Element | null;
|
|
34
|
+
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
35
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & {
|
|
36
|
+
hideIcon?: boolean;
|
|
37
|
+
nameKey?: string;
|
|
38
|
+
} & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
|
|
39
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
3
|
+
import { Button } from "../controls/button.js";
|
|
4
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
7
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
8
|
+
type CarouselProps = {
|
|
9
|
+
opts?: CarouselOptions;
|
|
10
|
+
plugins?: CarouselPlugin;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
setApi?: (api: CarouselApi) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
|
|
15
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
18
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
19
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
declare function Collapsible(props: ComponentProps<typeof CollapsiblePrimitive.Root>): import("react").JSX.Element;
|
|
4
|
+
declare function CollapsibleTrigger(props: ComponentProps<typeof CollapsiblePrimitive.Trigger>): import("react").JSX.Element;
|
|
5
|
+
declare function CollapsibleContent(props: ComponentProps<typeof CollapsiblePrimitive.Content>): import("react").JSX.Element;
|
|
6
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
type PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Content>;
|
|
6
|
+
declare function PopoverContent(props: PopoverContentProps): React.JSX.Element;
|
|
7
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
8
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
|
|
10
|
+
declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
11
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Controls visibility; omit for hover and focus behavior. */
|
|
6
|
+
open?: boolean | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function Tooltip({ label, children, open }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
export declare function usePortalScope(): {
|
|
3
|
+
container: HTMLElement | null;
|
|
4
|
+
boundary?: Element;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Space below the viewport that overlays may extend into, in pixels. The
|
|
8
|
+
* iframe runtime provides it: the host grows a content-sized frame to show an
|
|
9
|
+
* overlay that extends past its bottom, so an overlay need not flip above its
|
|
10
|
+
* trigger, where the frame's top would clip it.
|
|
11
|
+
*/
|
|
12
|
+
export interface OverlayRoom {
|
|
13
|
+
below(): number;
|
|
14
|
+
subscribe(listener: () => void): () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const OverlayRoomContext: import("react").Context<OverlayRoom | null>;
|
|
17
|
+
type Side = "top" | "right" | "bottom" | "left";
|
|
18
|
+
export type CollisionPadding = number | Partial<Record<Side, number>>;
|
|
19
|
+
/** Extends an overlay's collision padding by the room below the viewport. */
|
|
20
|
+
export declare function useCollisionPadding(padding?: CollisionPadding): CollisionPadding;
|
|
21
|
+
export interface UiScopeProps extends ComponentProps<"section"> {
|
|
22
|
+
appearance?: "light" | "dark";
|
|
23
|
+
tokens?: Readonly<Record<`--${string}`, string>>;
|
|
24
|
+
boundary?: Element;
|
|
25
|
+
}
|
|
26
|
+
export declare function UiScope({ children, className, style, appearance, tokens, boundary, ...props }: UiScopeProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import type { DilComponentProps } from "./customization.js";
|
|
3
|
+
export interface CustomComponentProps {
|
|
4
|
+
component: ComponentType<DilComponentProps>;
|
|
5
|
+
name: string;
|
|
6
|
+
attributes: Readonly<Record<string, unknown>>;
|
|
7
|
+
config: Readonly<Record<string, unknown>>;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className: string;
|
|
10
|
+
slots: Readonly<Record<string, string>>;
|
|
11
|
+
ready: boolean;
|
|
12
|
+
presentationRef?: ((element: HTMLElement | null) => void) | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function CustomComponent({ component: Component, attributes, ...props }: CustomComponentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
export interface DilComponentProps {
|
|
3
|
+
name: string;
|
|
4
|
+
attributes: Readonly<Record<string, unknown>>;
|
|
5
|
+
config: Readonly<Record<string, unknown>>;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
className: string;
|
|
8
|
+
slots: Readonly<Record<string, string>>;
|
|
9
|
+
ready: boolean;
|
|
10
|
+
invoke: (attribute: string, value?: unknown) => void;
|
|
11
|
+
/** Forward to the visual root to participate in progressive reveal. */
|
|
12
|
+
presentationRef?: ((element: HTMLElement | null) => void) | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface DilCustomization {
|
|
15
|
+
components?: Readonly<Record<string, ComponentType<DilComponentProps>>>;
|
|
16
|
+
componentConfig?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
17
|
+
classNames?: Readonly<Record<string, string>>;
|
|
18
|
+
slots?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
19
|
+
}
|
|
20
|
+
export declare const CustomizationContext: import("react").Context<DilCustomization>;
|
|
21
|
+
export declare function useCustomization(): DilCustomization;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import type { DilRendererHandle } from "./renderer-handle.js";
|
|
3
|
+
import type { DilCustomization } from "./customization.js";
|
|
4
|
+
import type { RendererMetrics } from "./renderer-environment.js";
|
|
5
|
+
import type { DilRenderError } from "./render-error.js";
|
|
6
|
+
import type { ProgressiveReveal } from "./view/reveal-options.js";
|
|
7
|
+
import type { AutoScroll, ScrollContainer } from "./view/scroll-options.js";
|
|
8
|
+
import { type UpdateInterval } from "./runtime/presentation-scheduler.js";
|
|
9
|
+
/**
|
|
10
|
+
* Starts loading the code that `mode="host"` and `mode="shadow"` share. Once
|
|
11
|
+
* it resolves, those modes render synchronously: their `ref` is set in the
|
|
12
|
+
* first commit and `renderToString` includes them.
|
|
13
|
+
*/
|
|
14
|
+
export declare function preloadHostRenderer(): Promise<void>;
|
|
15
|
+
interface DilCommonProps {
|
|
16
|
+
ref?: Ref<DilRendererHandle> | undefined;
|
|
17
|
+
/** Append-only source prefix. Remount with a new key to replace it. */
|
|
18
|
+
text: string;
|
|
19
|
+
isStreaming?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Show the "Receiving document", "Incomplete" or "Complete" label. Errors
|
|
22
|
+
* and the note that a response ended early stay visible when false.
|
|
23
|
+
*/
|
|
24
|
+
showStatus?: boolean;
|
|
25
|
+
/** Stagger newly shown blocks; disabled by default and under reduced motion. */
|
|
26
|
+
progressiveReveal?: ProgressiveReveal;
|
|
27
|
+
autoScroll?: AutoScroll;
|
|
28
|
+
/**
|
|
29
|
+
* What scrolls around the renderer, for `autoScroll` and for virtualized
|
|
30
|
+
* long content. Defaults to `"auto"`: the nearest ancestor that scrolls
|
|
31
|
+
* vertically, crossing Shadow DOM boundaries, or the window when none does.
|
|
32
|
+
* Pass `"window"`, an element, or a ref to an element to choose one.
|
|
33
|
+
*/
|
|
34
|
+
scrollContainer?: ScrollContainer | undefined;
|
|
35
|
+
/** Maximum streaming presentation frequency; user interaction remains immediate. */
|
|
36
|
+
updateInterval?: UpdateInterval;
|
|
37
|
+
/** Color scheme of the stock components. Defaults to "light". */
|
|
38
|
+
appearance?: "light" | "dark" | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* CSS custom properties applied to the renderer root, such as `--primary` or
|
|
41
|
+
* `--background`. The iframe mode accepts only values that cannot load
|
|
42
|
+
* resources and ignores the rest with a console warning.
|
|
43
|
+
*/
|
|
44
|
+
tokens?: Readonly<Record<`--${string}`, string>> | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* URL of the directory that serves frame.html. Defaults to "/opendil/". Only
|
|
47
|
+
* the iframe mode loads it; host and Shadow DOM modes ignore it, so a mode
|
|
48
|
+
* chosen at runtime can always pass the app's runtime location.
|
|
49
|
+
*/
|
|
50
|
+
runtimeBaseUrl?: string | undefined;
|
|
51
|
+
onFollowChange?: (following: boolean) => void;
|
|
52
|
+
onInput?: (detail: {
|
|
53
|
+
length: number;
|
|
54
|
+
}) => void;
|
|
55
|
+
onCommit?: (detail: RendererMetrics) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Receives each distinct problem once, with a developer-facing message and,
|
|
58
|
+
* for parse problems, the offset in `text`. Readers see short generic
|
|
59
|
+
* wording instead. Syntax problems and documents that ended with unfinished
|
|
60
|
+
* structure are also logged with `console.warn`. One message reports at most
|
|
61
|
+
* 20 problems, then one `limit` error; the `incomplete` report always
|
|
62
|
+
* arrives. An exception thrown here is rethrown asynchronously and does not
|
|
63
|
+
* interrupt rendering.
|
|
64
|
+
*/
|
|
65
|
+
onError?: ((error: DilRenderError) => void) | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface DilIsolatedRendererProps extends DilCommonProps {
|
|
68
|
+
mode?: "isolated" | undefined;
|
|
69
|
+
components?: undefined;
|
|
70
|
+
componentConfig?: undefined;
|
|
71
|
+
classNames?: undefined;
|
|
72
|
+
slots?: undefined;
|
|
73
|
+
className?: undefined;
|
|
74
|
+
shadowStyles?: undefined;
|
|
75
|
+
}
|
|
76
|
+
interface DilStyledRendererProps extends DilCommonProps, DilCustomization {
|
|
77
|
+
className?: string | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface DilHostRendererProps extends DilStyledRendererProps {
|
|
80
|
+
mode: "host";
|
|
81
|
+
shadowStyles?: undefined;
|
|
82
|
+
}
|
|
83
|
+
export interface DilShadowRendererProps extends DilStyledRendererProps {
|
|
84
|
+
mode: "shadow";
|
|
85
|
+
/** Trusted application CSS installed inside this renderer's ShadowRoot. */
|
|
86
|
+
shadowStyles?: string | undefined;
|
|
87
|
+
}
|
|
88
|
+
export type DilRendererProps = DilIsolatedRendererProps | DilHostRendererProps | DilShadowRendererProps;
|
|
89
|
+
export declare function DilRenderer(props: DilRendererProps): import("react").JSX.Element;
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Package version, compiled into both the renderer and the copied frame runtime. */
|
|
2
|
+
export declare const RUNTIME_VERSION: string;
|
|
3
|
+
/**
|
|
4
|
+
* The frame script runs before the frame document's load event, so a frame that
|
|
5
|
+
* loaded without announcing itself is not the OpenDIL runtime.
|
|
6
|
+
*/
|
|
7
|
+
export declare const READY_AFTER_LOAD_MS = 3000;
|
|
8
|
+
/**
|
|
9
|
+
* frame.html pings the host every second while frame.js downloads, so this
|
|
10
|
+
* limit applies only to a frame that has sent nothing at all, such as an app
|
|
11
|
+
* page whose load event fired before the renderer hydrated.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SILENT_FRAME_MS = 20000;
|
|
14
|
+
export declare function startupFailureMessage(url: string): string;
|
|
15
|
+
export declare function reportStartupFailure(url: string): void;
|
|
16
|
+
/** Warns once per frame URL when the copied runtime and the renderer differ. */
|
|
17
|
+
export declare function checkFrameVersion(url: string, version: unknown): void;
|
|
18
|
+
export declare function reportRejectedTokens(names: readonly string[]): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Appearance = "light" | "dark";
|
|
2
|
+
export type ThemeTokens = Readonly<Record<`--${string}`, string>>;
|
|
3
|
+
export interface FrameTheme {
|
|
4
|
+
appearance: Appearance;
|
|
5
|
+
tokens: ThemeTokens;
|
|
6
|
+
}
|
|
7
|
+
export declare function isSafeTokenValue(value: string): boolean;
|
|
8
|
+
/** Keeps valid custom properties and names everything it drops. */
|
|
9
|
+
export declare function readThemeTokens(value: unknown): {
|
|
10
|
+
tokens: ThemeTokens;
|
|
11
|
+
rejected: string[];
|
|
12
|
+
};
|
|
13
|
+
/** Parses a port message into a theme, or returns undefined to ignore it. */
|
|
14
|
+
export declare function readFrameTheme(data: object): FrameTheme | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ScrollRootTracker } from "../view/scroll/root-tracker.js";
|
|
2
|
+
export interface FrameViewportMessage {
|
|
3
|
+
type: "viewport";
|
|
4
|
+
revision: number;
|
|
5
|
+
offset: number;
|
|
6
|
+
height: number;
|
|
7
|
+
width: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tells the frame which part of it is visible in the host's scroller, the
|
|
11
|
+
* page or a scroll container, so virtualized content inside can mount.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FrameViewportReporter {
|
|
14
|
+
private readonly frame;
|
|
15
|
+
private readonly scroller;
|
|
16
|
+
private readonly post;
|
|
17
|
+
private revision;
|
|
18
|
+
private lastOffset;
|
|
19
|
+
private observed;
|
|
20
|
+
private readonly stop;
|
|
21
|
+
constructor(frame: HTMLIFrameElement, scroller: ScrollRootTracker, post: (message: FrameViewportMessage) => void);
|
|
22
|
+
private visible;
|
|
23
|
+
report: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Scrolls the host until frame offset `offset` is at the visible top. A
|
|
26
|
+
* request from before the reader's latest scroll is discarded.
|
|
27
|
+
*/
|
|
28
|
+
scroll(offset: number, revision: number): void;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import type { DilRendererHandle } from "../renderer-handle.js";
|
|
3
|
+
import type { RendererMetrics } from "../renderer-environment.js";
|
|
4
|
+
import { type DilRenderError } from "../render-error.js";
|
|
5
|
+
import type { ProgressiveReveal } from "../view/reveal-options.js";
|
|
6
|
+
import type { AutoScroll, ScrollContainer } from "../view/scroll-options.js";
|
|
7
|
+
import type { UpdateInterval } from "../runtime/presentation-scheduler.js";
|
|
8
|
+
import { type Appearance, type ThemeTokens } from "./frame-theme.js";
|
|
9
|
+
export interface IsolatedRendererProps {
|
|
10
|
+
ref?: Ref<DilRendererHandle> | undefined;
|
|
11
|
+
text: string;
|
|
12
|
+
isStreaming?: boolean;
|
|
13
|
+
showStatus?: boolean;
|
|
14
|
+
progressiveReveal?: ProgressiveReveal;
|
|
15
|
+
autoScroll?: AutoScroll;
|
|
16
|
+
scrollContainer?: ScrollContainer | undefined;
|
|
17
|
+
updateInterval?: UpdateInterval;
|
|
18
|
+
onFollowChange?: (following: boolean) => void;
|
|
19
|
+
runtimeBaseUrl?: string | undefined;
|
|
20
|
+
appearance?: Appearance | undefined;
|
|
21
|
+
tokens?: ThemeTokens | undefined;
|
|
22
|
+
onInput?: (detail: {
|
|
23
|
+
length: number;
|
|
24
|
+
}) => void;
|
|
25
|
+
onCommit?: (detail: RendererMetrics) => void;
|
|
26
|
+
onError?: ((error: DilRenderError) => void) | undefined;
|
|
27
|
+
}
|
|
28
|
+
export declare function IsolatedRenderer({ ref, text, isStreaming, showStatus, progressiveReveal, autoScroll, scrollContainer, updateInterval, onFollowChange, runtimeBaseUrl, appearance, tokens, onInput, onCommit, onError, }: IsolatedRendererProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { OverlayRoom } from "../../components/ui/overlays/ui-scope.js";
|
|
2
|
+
/**
|
|
3
|
+
* Decides how far overlays may extend below the frame's bottom. The host grows
|
|
4
|
+
* the content-sized frame to show an overlay that extends past it, but cannot
|
|
5
|
+
* grow it upward, so an overlay that flips above a trigger is clipped at the
|
|
6
|
+
* frame's top.
|
|
7
|
+
*
|
|
8
|
+
* Overlays may use the part of the host's scroller that is visible below the
|
|
9
|
+
* frame, as they would in host mode. When one is clipped at the top anyway, for
|
|
10
|
+
* example in a short frame at the bottom of the scroller, overlays may extend
|
|
11
|
+
* any distance below until all of them close, and the reader can scroll to them.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FrameOverlayRoom implements OverlayRoom {
|
|
14
|
+
private readonly visibleBottom;
|
|
15
|
+
private readonly frameHeight;
|
|
16
|
+
private readonly listeners;
|
|
17
|
+
private room;
|
|
18
|
+
private unbounded;
|
|
19
|
+
/** `visibleBottom` is the bottom of the host's visible area, in frame coordinates. */
|
|
20
|
+
constructor(visibleBottom: () => number, frameHeight: () => number);
|
|
21
|
+
below: () => number;
|
|
22
|
+
subscribe: (listener: () => void) => () => void;
|
|
23
|
+
/** Recomputes the room after the visible area or the frame's height changed. */
|
|
24
|
+
update: () => void;
|
|
25
|
+
/** Receives the boxes of the placed, open overlays, in frame coordinates. */
|
|
26
|
+
track(overlays: readonly {
|
|
27
|
+
top: number;
|
|
28
|
+
}[]): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface ShadowRendererProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
shadowStyles?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
/** DOM/style encapsulation only. Expression isolation remains in the QuickJS worker. */
|
|
7
|
+
export declare function ShadowRenderer({ children, shadowStyles, }: ShadowRendererProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Coalesce measurement corrections after layout; discard them if the reader moved meanwhile. */
|
|
2
|
+
export declare function viewportScroller(viewport: {
|
|
3
|
+
readonly revision: number;
|
|
4
|
+
}, send: (offset: number, revision: number) => void): {
|
|
5
|
+
scroll(offset: number): void;
|
|
6
|
+
dispose(): void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import type { DilRendererHandle } from "./renderer-handle.js";
|
|
3
|
+
import type { ProgressiveReveal } from "./view/reveal-options.js";
|
|
4
|
+
import type { AutoScroll, ScrollContainer } from "./view/scroll-options.js";
|
|
5
|
+
import type { UpdateInterval } from "./runtime/presentation-scheduler.js";
|
|
6
|
+
export interface MessageRendererProps {
|
|
7
|
+
rendererRef?: Ref<DilRendererHandle> | undefined;
|
|
8
|
+
text: string;
|
|
9
|
+
isStreaming?: boolean;
|
|
10
|
+
showStatus?: boolean;
|
|
11
|
+
progressiveReveal?: ProgressiveReveal;
|
|
12
|
+
autoScroll?: AutoScroll;
|
|
13
|
+
scrollContainer?: ScrollContainer | undefined;
|
|
14
|
+
updateInterval?: UpdateInterval;
|
|
15
|
+
onFollowChange?: ((following: boolean) => void) | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function MessageRenderer({ rendererRef, text, isStreaming, showStatus, progressiveReveal, autoScroll, scrollContainer, updateInterval, onFollowChange, }: MessageRendererProps): import("react").JSX.Element;
|