@agimon-ai/doompi-web-components 0.0.1-alpha.4 → 0.0.1-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/components/Accordion.d.cts +4 -4
- package/dist/components/Accordion.d.cts.map +1 -1
- package/dist/components/Avatar.d.cts +3 -3
- package/dist/components/Avatar.d.cts.map +1 -1
- package/dist/components/Badge.d.cts +1 -1
- package/dist/components/Badge.d.cts.map +1 -1
- package/dist/components/Breadcrumb.d.cts +1 -1
- package/dist/components/Breadcrumb.d.cts.map +1 -1
- package/dist/components/Button.d.cts +1 -1
- package/dist/components/Button.d.cts.map +1 -1
- package/dist/components/Checkbox.d.cts +1 -1
- package/dist/components/Checkbox.d.cts.map +1 -1
- package/dist/components/CodeEditor.d.cts +1 -1
- package/dist/components/CodeEditor.d.cts.map +1 -1
- package/dist/components/Collapsible.d.cts +3 -3
- package/dist/components/Collapsible.d.cts.map +1 -1
- package/dist/components/Command.d.cts +10 -10
- package/dist/components/Command.d.cts.map +1 -1
- package/dist/components/Dialog.d.cts +9 -9
- package/dist/components/Dialog.d.cts.map +1 -1
- package/dist/components/Dot.d.cts +1 -1
- package/dist/components/Dot.d.cts.map +1 -1
- package/dist/components/DropdownMenu.d.cts +14 -14
- package/dist/components/DropdownMenu.d.cts.map +1 -1
- package/dist/components/EmptyState.d.cts +1 -1
- package/dist/components/EmptyState.d.cts.map +1 -1
- package/dist/components/HashlineLines.d.cts +17 -0
- package/dist/components/HashlineLines.d.cts.map +1 -0
- package/dist/components/Input.d.cts +1 -1
- package/dist/components/Input.d.cts.map +1 -1
- package/dist/components/Kbd.d.cts +1 -1
- package/dist/components/Kbd.d.cts.map +1 -1
- package/dist/components/Label.d.cts +1 -1
- package/dist/components/Label.d.cts.map +1 -1
- package/dist/components/Markdown.d.cts +13 -3
- package/dist/components/Markdown.d.cts.map +1 -1
- package/dist/components/MediaPreview.d.cts +1 -1
- package/dist/components/MediaPreview.d.cts.map +1 -1
- package/dist/components/MessageItem.d.cts +4 -4
- package/dist/components/MessageItem.d.cts.map +1 -1
- package/dist/components/MessageLines.d.cts +1 -1
- package/dist/components/MessageLines.d.cts.map +1 -1
- package/dist/components/OptionList.d.cts +3 -3
- package/dist/components/OptionList.d.cts.map +1 -1
- package/dist/components/Panel.d.cts +3 -3
- package/dist/components/Panel.d.cts.map +1 -1
- package/dist/components/Popover.d.cts +7 -7
- package/dist/components/Popover.d.cts.map +1 -1
- package/dist/components/Progress.d.cts +1 -1
- package/dist/components/Progress.d.cts.map +1 -1
- package/dist/components/RadioGroup.d.cts +3 -3
- package/dist/components/RadioGroup.d.cts.map +1 -1
- package/dist/components/ScrollArea.d.cts +2 -2
- package/dist/components/ScrollArea.d.cts.map +1 -1
- package/dist/components/SectionLabel.d.cts +1 -1
- package/dist/components/SectionLabel.d.cts.map +1 -1
- package/dist/components/Select.d.cts +8 -8
- package/dist/components/Select.d.cts.map +1 -1
- package/dist/components/Separator.d.cts +1 -1
- package/dist/components/Separator.d.cts.map +1 -1
- package/dist/components/Sheet.d.cts +36 -0
- package/dist/components/Sheet.d.cts.map +1 -0
- package/dist/components/Skeleton.d.cts +1 -1
- package/dist/components/Skeleton.d.cts.map +1 -1
- package/dist/components/Spinner.d.cts +1 -1
- package/dist/components/Spinner.d.cts.map +1 -1
- package/dist/components/StatusBadge.d.cts +1 -1
- package/dist/components/StatusBadge.d.cts.map +1 -1
- package/dist/components/StreamCursor.d.cts +1 -1
- package/dist/components/StreamCursor.d.cts.map +1 -1
- package/dist/components/Switch.d.cts +1 -1
- package/dist/components/Switch.d.cts.map +1 -1
- package/dist/components/Tabs.d.cts +6 -6
- package/dist/components/Tabs.d.cts.map +1 -1
- package/dist/components/Textarea.d.cts +1 -1
- package/dist/components/Textarea.d.cts.map +1 -1
- package/dist/components/Toast.d.cts +7 -7
- package/dist/components/Toast.d.cts.map +1 -1
- package/dist/components/Tooltip.d.cts +4 -4
- package/dist/components/Tooltip.d.cts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/hashlineView.d.cts +61 -0
- package/dist/lib/hashlineView.d.cts.map +1 -0
- package/dist/src/components/Accordion.d.mts +4 -4
- package/dist/src/components/Accordion.d.mts.map +1 -1
- package/dist/src/components/Avatar.d.mts +3 -3
- package/dist/src/components/Avatar.d.mts.map +1 -1
- package/dist/src/components/Badge.d.mts +1 -1
- package/dist/src/components/Badge.d.mts.map +1 -1
- package/dist/src/components/Breadcrumb.d.mts +1 -1
- package/dist/src/components/Breadcrumb.d.mts.map +1 -1
- package/dist/src/components/Button.d.mts +1 -1
- package/dist/src/components/Button.d.mts.map +1 -1
- package/dist/src/components/Checkbox.d.mts +1 -1
- package/dist/src/components/Checkbox.d.mts.map +1 -1
- package/dist/src/components/CodeEditor.d.mts +1 -1
- package/dist/src/components/CodeEditor.d.mts.map +1 -1
- package/dist/src/components/CodeEditorView.cjs +1 -1
- package/dist/src/components/CodeEditorView.cjs.map +1 -1
- package/dist/src/components/CodeEditorView.mjs +1 -1
- package/dist/src/components/CodeEditorView.mjs.map +1 -1
- package/dist/src/components/Collapsible.d.mts +3 -3
- package/dist/src/components/Collapsible.d.mts.map +1 -1
- package/dist/src/components/Command.d.mts +10 -10
- package/dist/src/components/Command.d.mts.map +1 -1
- package/dist/src/components/Dialog.d.mts +9 -9
- package/dist/src/components/Dialog.d.mts.map +1 -1
- package/dist/src/components/Dot.d.mts +1 -1
- package/dist/src/components/Dot.d.mts.map +1 -1
- package/dist/src/components/DropdownMenu.d.mts +14 -14
- package/dist/src/components/DropdownMenu.d.mts.map +1 -1
- package/dist/src/components/EmptyState.d.mts +1 -1
- package/dist/src/components/EmptyState.d.mts.map +1 -1
- package/dist/src/components/HashlineLines.cjs +2 -0
- package/dist/src/components/HashlineLines.cjs.map +1 -0
- package/dist/src/components/HashlineLines.d.mts +17 -0
- package/dist/src/components/HashlineLines.d.mts.map +1 -0
- package/dist/src/components/HashlineLines.mjs +2 -0
- package/dist/src/components/HashlineLines.mjs.map +1 -0
- package/dist/src/components/Input.d.mts +1 -1
- package/dist/src/components/Input.d.mts.map +1 -1
- package/dist/src/components/Kbd.d.mts +1 -1
- package/dist/src/components/Kbd.d.mts.map +1 -1
- package/dist/src/components/Label.d.mts +1 -1
- package/dist/src/components/Label.d.mts.map +1 -1
- package/dist/src/components/Markdown.cjs +2 -1
- package/dist/src/components/Markdown.cjs.map +1 -1
- package/dist/src/components/Markdown.d.mts +13 -3
- package/dist/src/components/Markdown.d.mts.map +1 -1
- package/dist/src/components/Markdown.mjs +2 -1
- package/dist/src/components/Markdown.mjs.map +1 -1
- package/dist/src/components/MediaPreview.cjs +1 -1
- package/dist/src/components/MediaPreview.cjs.map +1 -1
- package/dist/src/components/MediaPreview.d.mts +1 -1
- package/dist/src/components/MediaPreview.d.mts.map +1 -1
- package/dist/src/components/MediaPreview.mjs +1 -1
- package/dist/src/components/MediaPreview.mjs.map +1 -1
- package/dist/src/components/MessageItem.d.mts +4 -4
- package/dist/src/components/MessageItem.d.mts.map +1 -1
- package/dist/src/components/MessageLines.d.mts +1 -1
- package/dist/src/components/MessageLines.d.mts.map +1 -1
- package/dist/src/components/OptionList.d.mts +3 -3
- package/dist/src/components/OptionList.d.mts.map +1 -1
- package/dist/src/components/Panel.d.mts +3 -3
- package/dist/src/components/Panel.d.mts.map +1 -1
- package/dist/src/components/Popover.d.mts +7 -7
- package/dist/src/components/Popover.d.mts.map +1 -1
- package/dist/src/components/Progress.d.mts +1 -1
- package/dist/src/components/Progress.d.mts.map +1 -1
- package/dist/src/components/RadioGroup.d.mts +3 -3
- package/dist/src/components/RadioGroup.d.mts.map +1 -1
- package/dist/src/components/ScrollArea.d.mts +2 -2
- package/dist/src/components/ScrollArea.d.mts.map +1 -1
- package/dist/src/components/SectionLabel.d.mts +1 -1
- package/dist/src/components/SectionLabel.d.mts.map +1 -1
- package/dist/src/components/Select.d.mts +8 -8
- package/dist/src/components/Select.d.mts.map +1 -1
- package/dist/src/components/Separator.d.mts +1 -1
- package/dist/src/components/Separator.d.mts.map +1 -1
- package/dist/src/components/Sheet.cjs +2 -0
- package/dist/src/components/Sheet.cjs.map +1 -0
- package/dist/src/components/Sheet.d.mts +36 -0
- package/dist/src/components/Sheet.d.mts.map +1 -0
- package/dist/src/components/Sheet.mjs +2 -0
- package/dist/src/components/Sheet.mjs.map +1 -0
- package/dist/src/components/Skeleton.d.mts +1 -1
- package/dist/src/components/Skeleton.d.mts.map +1 -1
- package/dist/src/components/Spinner.cjs +1 -1
- package/dist/src/components/Spinner.cjs.map +1 -1
- package/dist/src/components/Spinner.d.mts +1 -1
- package/dist/src/components/Spinner.d.mts.map +1 -1
- package/dist/src/components/Spinner.mjs +1 -1
- package/dist/src/components/Spinner.mjs.map +1 -1
- package/dist/src/components/StatusBadge.d.mts +1 -1
- package/dist/src/components/StatusBadge.d.mts.map +1 -1
- package/dist/src/components/StreamCursor.d.mts +1 -1
- package/dist/src/components/StreamCursor.d.mts.map +1 -1
- package/dist/src/components/Switch.d.mts +1 -1
- package/dist/src/components/Switch.d.mts.map +1 -1
- package/dist/src/components/Tabs.d.mts +6 -6
- package/dist/src/components/Tabs.d.mts.map +1 -1
- package/dist/src/components/Textarea.d.mts +1 -1
- package/dist/src/components/Textarea.d.mts.map +1 -1
- package/dist/src/components/Toast.d.mts +7 -7
- package/dist/src/components/Toast.d.mts.map +1 -1
- package/dist/src/components/Tooltip.d.mts +4 -4
- package/dist/src/components/Tooltip.d.mts.map +1 -1
- package/dist/src/lib/hashlineView.cjs +6 -0
- package/dist/src/lib/hashlineView.cjs.map +1 -0
- package/dist/src/lib/hashlineView.d.mts +61 -0
- package/dist/src/lib/hashlineView.d.mts.map +1 -0
- package/dist/src/lib/hashlineView.mjs +6 -0
- package/dist/src/lib/hashlineView.mjs.map +1 -0
- package/package.json +6 -6
- package/styles/tokens.css +22 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/lib/hashlineView.d.ts
|
|
2
|
+
declare const READ_COLLAPSED_LINES = 10;
|
|
3
|
+
declare const GREP_COLLAPSED_LINES = 15;
|
|
4
|
+
type HashlineResultKind = 'read' | 'grep';
|
|
5
|
+
type TaggedLineMarker = 'match' | 'context';
|
|
6
|
+
/**
|
|
7
|
+
* The part of a tool result this parser reads.
|
|
8
|
+
*
|
|
9
|
+
* Named structurally rather than imported: the component library sits below
|
|
10
|
+
* the web contract and must not depend on it, so it states the shape it needs
|
|
11
|
+
* and any `ToolResultView` satisfies it.
|
|
12
|
+
*/
|
|
13
|
+
interface HashlineResult {
|
|
14
|
+
readonly content: readonly unknown[];
|
|
15
|
+
}
|
|
16
|
+
interface TaggedLine {
|
|
17
|
+
readonly line: number;
|
|
18
|
+
readonly content: string;
|
|
19
|
+
readonly marker: TaggedLineMarker | undefined;
|
|
20
|
+
}
|
|
21
|
+
type PresentedLine = {
|
|
22
|
+
readonly type: 'file';
|
|
23
|
+
readonly path: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly type: 'tagged';
|
|
26
|
+
readonly value: TaggedLine;
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: 'plain';
|
|
29
|
+
readonly text: string;
|
|
30
|
+
};
|
|
31
|
+
interface HashlineBody {
|
|
32
|
+
readonly shown: readonly PresentedLine[];
|
|
33
|
+
/** Lines the collapsed view holds back; zero once expanded. */
|
|
34
|
+
readonly hidden: number;
|
|
35
|
+
/** The bracketed pagination or compaction note the tool appends after its lines. */
|
|
36
|
+
readonly notice: string | undefined;
|
|
37
|
+
/** Widest line number among the shown anchored lines, in characters. */
|
|
38
|
+
readonly gutter: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The result's text as lines: tabs widened, CRLF folded, trailing blanks
|
|
42
|
+
* dropped. A result with no text but an image block reads as the TUI's
|
|
43
|
+
* placeholder. The joined `output` stands in when no result view exists.
|
|
44
|
+
*/
|
|
45
|
+
declare function resultTextLines(result: HashlineResult | null, output: string): string[];
|
|
46
|
+
/** Detaches the tool's trailing `[...]` note so the body numbers file content only. */
|
|
47
|
+
declare function takeTrailingNotice(lines: string[]): string | undefined;
|
|
48
|
+
declare function parseTaggedLine(value: string): TaggedLine | undefined;
|
|
49
|
+
declare function parseFileHeader(value: string): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Lines as the card presents them. A read shows one file, so its header is
|
|
52
|
+
* dropped; a grep groups anchored matches under each file's path.
|
|
53
|
+
*/
|
|
54
|
+
declare function presentHashlineLines(lines: readonly string[], kind: HashlineResultKind): PresentedLine[];
|
|
55
|
+
/** The body a card shows for one result, collapsed to the kind's line budget unless expanded. */
|
|
56
|
+
declare function hashlineBody(result: HashlineResult | null, output: string, kind: HashlineResultKind, expanded: boolean): HashlineBody;
|
|
57
|
+
/** The `key · key` detail list beside a call's primary argument, with absent values dropped. */
|
|
58
|
+
declare function compactDetails(values: ReadonlyArray<string | undefined>): string[];
|
|
59
|
+
//#endregion
|
|
60
|
+
export { GREP_COLLAPSED_LINES, HashlineBody, HashlineResult, HashlineResultKind, PresentedLine, READ_COLLAPSED_LINES, TaggedLine, TaggedLineMarker, compactDetails, hashlineBody, parseFileHeader, parseTaggedLine, presentHashlineLines, resultTextLines, takeTrailingNotice };
|
|
61
|
+
//# sourceMappingURL=hashlineView.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashlineView.d.cts","names":[],"sources":["../../src/lib/hashlineView.ts"],"mappings":";cAoBa;cACA;KAED;KACA;;;;;;;;UASK;WACN;;UAGM;WACN;WACA;WACA,QAAQ;;KAGP;WACG;WAAuB;;WACvB;WAAyB,OAAO;;WAChC;WAAwB;;UAEtB;WACN,gBAAgB;;WAEhB;;WAEA;;WAEA;;;;;;;iBAiBK,gBAAgB,QAAQ,uBAAuB;;iBAa/C,mBAAmB;iBAQnB,gBAAgB,gBAAgB;iBAYhC,gBAAgB;;;;;iBAQhB,qBAAqB,0BAA0B,MAAM,qBAAqB;;iBAmB1E,aACd,QAAQ,uBACR,gBACA,MAAM,oBACN,oBACC;;iBAca,eAAe,QAAQ"}
|
|
@@ -2,10 +2,10 @@ import { Accordion } from "radix-ui";
|
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/components/Accordion.d.ts
|
|
4
4
|
/** Several collapsibles that know about each other; pass type="single" for one open at a time. */
|
|
5
|
-
declare function Accordion$1(props: ComponentProps<typeof Accordion.Root>): import("react
|
|
6
|
-
declare function AccordionItem({ className, ...props }: ComponentProps<typeof Accordion.Item>): import("react
|
|
7
|
-
declare function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof Accordion.Trigger>): import("react
|
|
8
|
-
declare function AccordionContent({ className, ...props }: ComponentProps<typeof Accordion.Content>): import("react
|
|
5
|
+
declare function Accordion$1(props: ComponentProps<typeof Accordion.Root>): import("react").JSX.Element;
|
|
6
|
+
declare function AccordionItem({ className, ...props }: ComponentProps<typeof Accordion.Item>): import("react").JSX.Element;
|
|
7
|
+
declare function AccordionTrigger({ className, children, ...props }: ComponentProps<typeof Accordion.Trigger>): import("react").JSX.Element;
|
|
8
|
+
declare function AccordionContent({ className, ...props }: ComponentProps<typeof Accordion.Content>): import("react").JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Accordion$1 as Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
11
11
|
//# sourceMappingURL=Accordion.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.mts","names":[],"sources":["../../../src/components/Accordion.tsx"],"mappings":";;;;iBAMgB,YAAU,OAAO,sBAAsB,UAAmB,
|
|
1
|
+
{"version":3,"file":"Accordion.d.mts","names":[],"sources":["../../../src/components/Accordion.tsx"],"mappings":";;;;iBAMgB,YAAU,OAAO,sBAAsB,UAAmB,wBAAK,IAAA;iBAI/D,gBAAgB,cAAc,SAAS,sBAAsB,UAAmB,wBAAK,IAAA;iBAUrF,mBAAmB,WAAW,aAAa,SAAS,sBAAsB,UAAmB,2BAAQ,IAAA;iBAkBrG,mBAAmB,cAAc,SAAS,sBAAsB,UAAmB,2BAAQ,IAAA"}
|
|
@@ -2,9 +2,9 @@ import { Avatar } from "radix-ui";
|
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/components/Avatar.d.ts
|
|
4
4
|
/** A face or an initial; Radix only shows the fallback once the image has actually failed. */
|
|
5
|
-
declare function Avatar$1({ className, ...props }: ComponentProps<typeof Avatar.Root>): import("react
|
|
6
|
-
declare function AvatarImage({ className, ...props }: ComponentProps<typeof Avatar.Image>): import("react
|
|
7
|
-
declare function AvatarFallback({ className, ...props }: ComponentProps<typeof Avatar.Fallback>): import("react
|
|
5
|
+
declare function Avatar$1({ className, ...props }: ComponentProps<typeof Avatar.Root>): import("react").JSX.Element;
|
|
6
|
+
declare function AvatarImage({ className, ...props }: ComponentProps<typeof Avatar.Image>): import("react").JSX.Element;
|
|
7
|
+
declare function AvatarFallback({ className, ...props }: ComponentProps<typeof Avatar.Fallback>): import("react").JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Avatar$1 as Avatar, AvatarFallback, AvatarImage };
|
|
10
10
|
//# sourceMappingURL=Avatar.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.mts","names":[],"sources":["../../../src/components/Avatar.tsx"],"mappings":";;;;iBAKgB,WAAS,cAAc,SAAS,sBAAsB,OAAgB,
|
|
1
|
+
{"version":3,"file":"Avatar.d.mts","names":[],"sources":["../../../src/components/Avatar.tsx"],"mappings":";;;;iBAKgB,WAAS,cAAc,SAAS,sBAAsB,OAAgB,wBAAK,IAAA;iBAU3E,cAAc,cAAc,SAAS,sBAAsB,OAAgB,yBAAM,IAAA;iBAUjF,iBAAiB,cAAc,SAAS,sBAAsB,OAAgB,4BAAS,IAAA"}
|
|
@@ -12,7 +12,7 @@ interface BadgeProps extends ComponentProps<'span'>, VariantProps<typeof badgeVa
|
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/** An outlined chip in one of the accent tones; the Chip the cockpit mockup draws. */
|
|
15
|
-
declare function Badge({ className, tone, size, asChild, ...props }: BadgeProps): import("react
|
|
15
|
+
declare function Badge({ className, tone, size, asChild, ...props }: BadgeProps): import("react").JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { Badge, BadgeProps, BadgeTone, badgeVariants };
|
|
18
18
|
//# sourceMappingURL=Badge.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.mts","names":[],"sources":["../../../src/components/Badge.tsx"],"mappings":";;;;cAMa,gBAAa;;;6CAuBxB;KAEU,YAAY;UAEP,mBAAmB,wBAAwB,oBAAoB;;EAE9E;;;iBAIc,QAAQ,WAAW,MAAM,MAAM,YAAoB,SAAS,
|
|
1
|
+
{"version":3,"file":"Badge.d.mts","names":[],"sources":["../../../src/components/Badge.tsx"],"mappings":";;;;cAMa,gBAAa;;;6CAuBxB;KAEU,YAAY;UAEP,mBAAmB,wBAAwB,oBAAoB;;EAE9E;;;iBAIc,QAAQ,WAAW,MAAM,MAAM,YAAoB,SAAS,6BAAU,IAAA"}
|
|
@@ -31,7 +31,7 @@ interface BreadcrumbProps {
|
|
|
31
31
|
* The leaf carries the emphasis. A reader scanning a header is looking for the
|
|
32
32
|
* file, and the directories are context for it.
|
|
33
33
|
*/
|
|
34
|
-
declare function Breadcrumb({ path, keep, className, 'data-testid': testId }: BreadcrumbProps): import("react
|
|
34
|
+
declare function Breadcrumb({ path, keep, className, 'data-testid': testId }: BreadcrumbProps): import("react").JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { BREADCRUMB_ELLIPSIS, Breadcrumb, BreadcrumbProps, breadcrumbSegments };
|
|
37
37
|
//# sourceMappingURL=Breadcrumb.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.d.mts","names":[],"sources":["../../../src/components/Breadcrumb.tsx"],"mappings":";;cAIa;;;;;;;;;iBAUG,mBAAmB,cAAc;UAQhC;;EAEf;;EAEA;;EAEA;EACA;;;;;;;;;;;;;;iBAec,aAAa,MAAM,MAAM,0BAA0B,UAAU,
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.mts","names":[],"sources":["../../../src/components/Breadcrumb.tsx"],"mappings":";;cAIa;;;;;;;;;iBAUG,mBAAmB,cAAc;UAQhC;;EAEf;;EAEA;;EAEA;EACA;;;;;;;;;;;;;;iBAec,aAAa,MAAM,MAAM,0BAA0B,UAAU,kCAAe,IAAA"}
|
|
@@ -19,7 +19,7 @@ interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof butt
|
|
|
19
19
|
loadingLabel?: string;
|
|
20
20
|
}
|
|
21
21
|
/** The one button: every variant is a theme token, so it recolours with the theme. */
|
|
22
|
-
declare function Button({ className, variant, size, asChild, loading, loadingLabel, disabled, type, children, ...props }: ButtonProps): import("react
|
|
22
|
+
declare function Button({ className, variant, size, asChild, loading, loadingLabel, disabled, type, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { Button, ButtonProps, ButtonSize, ButtonVariant, buttonVariants };
|
|
25
25
|
//# sourceMappingURL=Button.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.mts","names":[],"sources":["../../../src/components/Button.tsx"],"mappings":";;;cAMa,iBAAc;;;6CAgC1B;KAEW,gBAAgB,YAAY,oBAAoB;KAChD,aAAa,YAAY,oBAAoB;UAExC,oBAAoB,0BAA0B,oBAAoB;;EAEjF;;;;;EAKA;;EAEA;;;iBAIc,SACd,WACA,SACA,MACA,SACA,SACA,cACA,UACA,MACA,aACG,SACF,
|
|
1
|
+
{"version":3,"file":"Button.d.mts","names":[],"sources":["../../../src/components/Button.tsx"],"mappings":";;;cAMa,iBAAc;;;6CAgC1B;KAEW,gBAAgB,YAAY,oBAAoB;KAChD,aAAa,YAAY,oBAAoB;UAExC,oBAAoB,0BAA0B,oBAAoB;;EAEjF;;;;;EAKA;;EAEA;;;iBAIc,SACd,WACA,SACA,MACA,SACA,SACA,cACA,UACA,MACA,aACG,SACF,8BAAW,IAAA"}
|
|
@@ -2,7 +2,7 @@ import { Checkbox } from "radix-ui";
|
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/components/Checkbox.d.ts
|
|
4
4
|
/** A box that is on, off, or indeterminate; the tick is the accent on the deep well. */
|
|
5
|
-
declare function Checkbox$1({ className, ...props }: ComponentProps<typeof Checkbox.Root>): import("react
|
|
5
|
+
declare function Checkbox$1({ className, ...props }: ComponentProps<typeof Checkbox.Root>): import("react").JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Checkbox$1 as Checkbox };
|
|
8
8
|
//# sourceMappingURL=Checkbox.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.mts","names":[],"sources":["../../../src/components/Checkbox.tsx"],"mappings":";;;;iBAMgB,aAAW,cAAc,SAAS,sBAAsB,SAAkB,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.mts","names":[],"sources":["../../../src/components/Checkbox.tsx"],"mappings":";;;;iBAMgB,aAAW,cAAc,SAAS,sBAAsB,SAAkB,wBAAK,IAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CodeEditorProps } from "../types/editor.mjs";
|
|
2
2
|
//#region src/components/CodeEditor.d.ts
|
|
3
|
-
declare function CodeEditor({ className, ...props }: CodeEditorProps): import("react
|
|
3
|
+
declare function CodeEditor({ className, ...props }: CodeEditorProps): import("react").JSX.Element;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { CodeEditor };
|
|
6
6
|
//# sourceMappingURL=CodeEditor.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.mts","names":[],"sources":["../../../src/components/CodeEditor.tsx"],"mappings":";;iBAiBgB,aAAa,cAAc,SAAS,
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.mts","names":[],"sources":["../../../src/components/CodeEditor.tsx"],"mappings":";;iBAiBgB,aAAa,cAAc,SAAS,kCAAe,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs"),t=require("../lib/editorLanguage.cjs"),n=require("../lib/editorTheme.cjs");let r=require("react/jsx-runtime"),i=require("react"),a=require("@codemirror/commands"),o=require("@codemirror/language"),s=require("@codemirror/search"),c=require("@codemirror/state"),l=require("@codemirror/view"),u=require("@lezer/highlight");const d=l.EditorView.theme(n.DOOM_EDITOR_STYLES),f=o.HighlightStyle.define([{tag:u.tags.comment,...n.DOOM_SYNTAX_STYLES.comment},{tag:u.tags.keyword,...n.DOOM_SYNTAX_STYLES.keyword},{tag:[u.tags.atom,u.tags.bool,u.tags.null,u.tags.self],...n.DOOM_SYNTAX_STYLES.constant},{tag:u.tags.number,...n.DOOM_SYNTAX_STYLES.literal},{tag:[u.tags.string,u.tags.special(u.tags.string),u.tags.character],...n.DOOM_SYNTAX_STYLES.string},{tag:u.tags.regexp,...n.DOOM_SYNTAX_STYLES.regexp},{tag:u.tags.operator,...n.DOOM_SYNTAX_STYLES.operator},{tag:u.tags.punctuation,...n.DOOM_SYNTAX_STYLES.punctuation},{tag:u.tags.variableName,...n.DOOM_SYNTAX_STYLES.variable},{tag:u.tags.propertyName,...n.DOOM_SYNTAX_STYLES.property},{tag:[u.tags.function(u.tags.variableName),u.tags.function(u.tags.propertyName)],...n.DOOM_SYNTAX_STYLES.callable},{tag:[u.tags.typeName,u.tags.className,u.tags.namespace],...n.DOOM_SYNTAX_STYLES.type},{tag:u.tags.tagName,...n.DOOM_SYNTAX_STYLES.tag},{tag:u.tags.attributeName,...n.DOOM_SYNTAX_STYLES.attribute},{tag:[u.tags.meta,u.tags.processingInstruction],...n.DOOM_SYNTAX_STYLES.meta},{tag:u.tags.heading,...n.DOOM_SYNTAX_STYLES.heading},{tag:[u.tags.link,u.tags.url],...n.DOOM_SYNTAX_STYLES.link},{tag:u.tags.emphasis,...n.DOOM_SYNTAX_STYLES.emphasis},{tag:u.tags.strong,...n.DOOM_SYNTAX_STYLES.strong},{tag:u.tags.strikethrough,...n.DOOM_SYNTAX_STYLES.strikethrough},{tag:u.tags.invalid,...n.DOOM_SYNTAX_STYLES.invalid}]),p=[(0,l.lineNumbers)(),(0,l.highlightActiveLineGutter)(),(0,o.foldGutter)(),(0,l.highlightActiveLine)(),(0,l.drawSelection)(),(0,l.rectangularSelection)(),(0,o.indentOnInput)(),(0,o.bracketMatching)(),(0,a.history)(),(0,s.search)({top:!0}),(0,s.highlightSelectionMatches)(),l.keymap.of([...a.defaultKeymap,...a.historyKeymap,...s.searchKeymap,...o.foldKeymap,a.indentWithTab]),(0,o.syntaxHighlighting)(f),d];function m({value:n,path:a,readOnly:o=!1,lineWrapping:s=!0,className:u,onChange:d,onSelect:f,"data-testid":m}){let h=(0,i.useRef)(null),g=(0,i.useRef)(null),_=(0,i.useRef)({onChange:d,onSelect:f}),v=(0,i.useRef)({language:new c.Compartment,readOnly:new c.Compartment,wrapping:new c.Compartment});return(0,i.useEffect)(()=>{_.current={onChange:d,onSelect:f}}),(0,i.useEffect)(()=>{let e=h.current;if(e===null)return;let{language:t,readOnly:
|
|
1
|
+
const e=require("../lib/cn.cjs"),t=require("../lib/editorLanguage.cjs"),n=require("../lib/editorTheme.cjs");let r=require("react/jsx-runtime"),i=require("react"),a=require("@codemirror/commands"),o=require("@codemirror/language"),s=require("@codemirror/search"),c=require("@codemirror/state"),l=require("@codemirror/view"),u=require("@lezer/highlight");const d=l.EditorView.theme(n.DOOM_EDITOR_STYLES),f=o.HighlightStyle.define([{tag:u.tags.comment,...n.DOOM_SYNTAX_STYLES.comment},{tag:u.tags.keyword,...n.DOOM_SYNTAX_STYLES.keyword},{tag:[u.tags.atom,u.tags.bool,u.tags.null,u.tags.self],...n.DOOM_SYNTAX_STYLES.constant},{tag:u.tags.number,...n.DOOM_SYNTAX_STYLES.literal},{tag:[u.tags.string,u.tags.special(u.tags.string),u.tags.character],...n.DOOM_SYNTAX_STYLES.string},{tag:u.tags.regexp,...n.DOOM_SYNTAX_STYLES.regexp},{tag:u.tags.operator,...n.DOOM_SYNTAX_STYLES.operator},{tag:u.tags.punctuation,...n.DOOM_SYNTAX_STYLES.punctuation},{tag:u.tags.variableName,...n.DOOM_SYNTAX_STYLES.variable},{tag:u.tags.propertyName,...n.DOOM_SYNTAX_STYLES.property},{tag:[u.tags.function(u.tags.variableName),u.tags.function(u.tags.propertyName)],...n.DOOM_SYNTAX_STYLES.callable},{tag:[u.tags.typeName,u.tags.className,u.tags.namespace],...n.DOOM_SYNTAX_STYLES.type},{tag:u.tags.tagName,...n.DOOM_SYNTAX_STYLES.tag},{tag:u.tags.attributeName,...n.DOOM_SYNTAX_STYLES.attribute},{tag:[u.tags.meta,u.tags.processingInstruction],...n.DOOM_SYNTAX_STYLES.meta},{tag:u.tags.heading,...n.DOOM_SYNTAX_STYLES.heading},{tag:[u.tags.link,u.tags.url],...n.DOOM_SYNTAX_STYLES.link},{tag:u.tags.emphasis,...n.DOOM_SYNTAX_STYLES.emphasis},{tag:u.tags.strong,...n.DOOM_SYNTAX_STYLES.strong},{tag:u.tags.strikethrough,...n.DOOM_SYNTAX_STYLES.strikethrough},{tag:u.tags.invalid,...n.DOOM_SYNTAX_STYLES.invalid}]),p=[(0,l.lineNumbers)(),(0,l.highlightActiveLineGutter)(),(0,o.foldGutter)(),(0,l.highlightActiveLine)(),(0,l.drawSelection)(),(0,l.rectangularSelection)(),(0,o.indentOnInput)(),(0,o.bracketMatching)(),(0,a.history)(),(0,s.search)({top:!0}),(0,s.highlightSelectionMatches)(),l.keymap.of([...a.defaultKeymap,...a.historyKeymap,...s.searchKeymap,...o.foldKeymap,a.indentWithTab]),(0,o.syntaxHighlighting)(f),d];function m({value:n,path:a,readOnly:o=!1,lineWrapping:s=!0,className:u,onChange:d,onSelect:f,"data-testid":m}){let h=(0,i.useRef)(null),g=(0,i.useRef)(null),_=(0,i.useRef)({onChange:d,onSelect:f}),v=(0,i.useRef)(n),y=(0,i.useRef)({language:new c.Compartment,readOnly:new c.Compartment,wrapping:new c.Compartment});return(0,i.useEffect)(()=>{_.current={onChange:d,onSelect:f}}),(0,i.useEffect)(()=>{let e=h.current;if(e===null)return;let{language:t,readOnly:n,wrapping:r}=y.current,i=new l.EditorView({parent:e,state:c.EditorState.create({doc:v.current,extensions:[...p,t.of([]),n.of([]),r.of([]),l.EditorView.updateListener.of(e=>{if(e.docChanged&&_.current.onChange?.(e.state.doc.toString()),!e.selectionSet&&!e.docChanged)return;let t=_.current.onSelect;if(t===void 0)return;let n=e.state.selection.main;t({text:e.state.sliceDoc(n.from,n.to),startLine:e.state.doc.lineAt(n.from).number,endLine:e.state.doc.lineAt(n.to).number})})]})});return g.current=i,()=>{i.destroy(),g.current=null}},[]),(0,i.useEffect)(()=>{let e=g.current;e!==null&&e.state.doc.toString()!==n&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:n}})},[n]),(0,i.useEffect)(()=>{g.current?.dispatch({effects:y.current.readOnly.reconfigure([c.EditorState.readOnly.of(o),l.EditorView.editable.of(!o)])})},[o]),(0,i.useEffect)(()=>{g.current?.dispatch({effects:y.current.wrapping.reconfigure(s?l.EditorView.lineWrapping:[])})},[s]),(0,i.useEffect)(()=>{let e=a===void 0?void 0:t.grammarKeyOf(a),{language:n}=y.current;if(e===void 0){g.current?.dispatch({effects:n.reconfigure([])});return}let r=!1;return t.loadGrammar(e).then(e=>{r||g.current?.dispatch({effects:n.reconfigure(e)})}).catch(()=>{r||g.current?.dispatch({effects:n.reconfigure([])})}),()=>{r=!0}},[a]),(0,r.jsx)(`div`,{ref:h,"data-testid":m,className:e.cn(`min-h-0 overflow-hidden`,u)})}exports.CodeEditorView=m;
|
|
2
2
|
//# sourceMappingURL=CodeEditorView.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorView.cjs","names":["EditorView","DOOM_EDITOR_STYLES","HighlightStyle","tags","DOOM_SYNTAX_STYLES","lineNumbers","highlightActiveLineGutter","foldGutter","highlightActiveLine","drawSelection","rectangularSelection","indentOnInput","bracketMatching","history","search","highlightSelectionMatches","keymap","defaultKeymap","historyKeymap","searchKeymap","foldKeymap","indentWithTab","syntaxHighlighting","useRef","Compartment","EditorState","grammarKeyOf","loadGrammar","cn"],"sources":["../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState } from '@codemirror/state';\nimport {\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useRef } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage.ts';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme.ts';\nimport type { CodeEditorProps } from '../types/editor.ts';\n\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: value,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report({\n text: update.state.sliceDoc(range.from, range.to),\n startLine: update.state.doc.lineAt(range.from).number,\n endLine: update.state.doc.lineAt(range.to).number,\n });\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once. `value` seeds the document and the sync effect owns it after that.\n }, []);\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":"iWA0CA,MAAM,EAAaA,EAAAA,WAAW,MAAMC,EAAAA,kBAAkB,EAEhD,EAAiBC,EAAAA,eAAe,OAAO,CAC3C,CAAE,IAAKC,EAAAA,KAAK,QAAS,GAAGC,EAAAA,mBAAmB,OAAQ,EACnD,CAAE,IAAKD,EAAAA,KAAK,QAAS,GAAGC,EAAAA,mBAAmB,OAAQ,EACnD,CAAE,IAAK,CAACD,EAAAA,KAAK,KAAMA,EAAAA,KAAK,KAAMA,EAAAA,KAAK,KAAMA,EAAAA,KAAK,IAAI,EAAG,GAAGC,EAAAA,mBAAmB,QAAS,EACpF,CAAE,IAAKD,EAAAA,KAAK,OAAQ,GAAGC,EAAAA,mBAAmB,OAAQ,EAClD,CAAE,IAAK,CAACD,EAAAA,KAAK,OAAQA,EAAAA,KAAK,QAAQA,EAAAA,KAA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CACjDyB,EAAAA,YAAY,SAAS,GAAG,CAAQ,EAChCzB,EAAAA,WAAW,SAAS,GAAG,CAAC,CAAQ,CAClC,CAAC,CACH,CAAC,CACH,EAAG,CAAC,CAAQ,CAAC,GAEb,EAAA,EAAA,UAAA,KAAgB,CACd,EAAK,SAAS,SAAS,CACrB,QAAS,EAAa,QAAQ,SAAS,YAAY,EAAeA,EAAAA,WAAW,aAAe,CAAC,CAAC,CAChG,CAAC,CACH,EAAG,CAAC,CAAY,CAAC,GAEjB,EAAA,EAAA,UAAA,KAAgB,CACd,IAAM,EAAM,IAAS,IAAA,GAAY,IAAA,GAAY0B,EAAAA,aAAa,CAAI,EACxD,CAAE,YAAa,EAAa,QAClC,GAAI,IAAQ,IAAA,GAAW,CACrB,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,EAC5D,MACF,CACA,IAAI,EAAY,GAWhB,OAVA,EAAKC,YAAY,CAAG,CAAC,CAClB,KAAM,GAAY,CACZ,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAO,CAAE,CAAC,CACnF,CAAC,CAAC,CACD,UAAY,CAIN,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,CAC9E,CAAC,MACU,CACX,EAAY,EACd,CACF,EAAG,CAAC,CAAI,CAAC,GAEF,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,IAAK,EAAM,cAAa,EAAQ,UAAWC,EAAAA,GAAG,0BAA2B,CAAS,CAAI,CAAA,CACpG"}
|
|
1
|
+
{"version":3,"file":"CodeEditorView.cjs","names":["EditorView","DOOM_EDITOR_STYLES","HighlightStyle","tags","DOOM_SYNTAX_STYLES","lineNumbers","highlightActiveLineGutter","foldGutter","highlightActiveLine","drawSelection","rectangularSelection","indentOnInput","bracketMatching","history","search","highlightSelectionMatches","keymap","defaultKeymap","historyKeymap","searchKeymap","foldKeymap","indentWithTab","syntaxHighlighting","useRef","Compartment","EditorState","grammarKeyOf","loadGrammar","cn"],"sources":["../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState } from '@codemirror/state';\nimport {\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useRef } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage.ts';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme.ts';\nimport type { CodeEditorProps } from '../types/editor.ts';\n\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n // The document is seeded once from the value of the first render; the sync effect\n // below owns every later change.\n const initialValue = useRef(value);\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: initialValue.current,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report({\n text: update.state.sliceDoc(range.from, range.to),\n startLine: update.state.doc.lineAt(range.from).number,\n endLine: update.state.doc.lineAt(range.to).number,\n });\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once.\n }, []);\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":"iWA0CA,MAAM,EAAaA,EAAAA,WAAW,MAAMC,EAAAA,kBAAkB,EAEhD,EAAiBC,EAAAA,eAAe,OAAO,CAC3C,CAAE,IAAKC,EAAAA,KAAK,QAAS,GAAGC,EAAAA,mBAAmB,OAAQ,EACnD,CAAE,IAAKD,EAAAA,KAAK,QAAS,GAAGC,EAAAA,mBAAmB,OAAQ,EACnD,CAAE,IAAK,CAACD,EAAAA,KAAK,KAAMA,EAAAA,KAAK,KAAMA,EAAAA,KAAK,KAAMA,EAAAA,KAAK,IAAI,EAAG,GAAGC,EAAAA,mBAAmB,QAAS,EACpF,CAAE,IAAKD,EAAAA,KAAK,OAAQ,GAAGC,EAAAA,mBAAmB,OAAQ,EAClD,CAAE,IAAK,CAACD,EAAAA,KAAK,OAAQA,EAAAA,KAAK,QAAQA,EAAAA,KAAK,MAAM,EAAGA,EAAAA,KAAK,SAAS,EAAG,GAAGC,EAAAA,mBAAmB,MAAO,EAC9F,CAAE,IAAKD,EAAAA,KAAK,OAAQ,GAAGC,EAAAA,mBAAmB,MAAO,EACjD,CAAE,IAAKD,EAAAA,KAAK,SAAU,GAAGC,EAAAA,mBAAmB,QAAS,EACrD,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,UAAA,KAAgB,CACd,EAAK,SAAS,SAAS,CACrB,QAAS,EAAa,QAAQ,SAAS,YAAY,EAAeA,EAAAA,WAAW,aAAe,CAAC,CAAC,CAChG,CAAC,CACH,EAAG,CAAC,CAAY,CAAC,GAEjB,EAAA,EAAA,UAAA,KAAgB,CACd,IAAM,EAAM,IAAS,IAAA,GAAY,IAAA,GAAY0B,EAAAA,aAAa,CAAI,EACxD,CAAE,YAAa,EAAa,QAClC,GAAI,IAAQ,IAAA,GAAW,CACrB,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,EAC5D,MACF,CACA,IAAI,EAAY,GAWhB,OAVA,EAAKC,YAAY,CAAG,CAAC,CAClB,KAAM,GAAY,CACZ,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAO,CAAE,CAAC,CACnF,CAAC,CAAC,CACD,UAAY,CAIN,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,CAC9E,CAAC,MACU,CACX,EAAY,EACd,CACF,EAAG,CAAC,CAAI,CAAC,GAEF,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,IAAK,EAAM,cAAa,EAAQ,UAAWC,EAAAA,GAAG,0BAA2B,CAAS,CAAI,CAAA,CACpG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{grammarKeyOf as t,loadGrammar as n}from"../lib/editorLanguage.mjs";import{DOOM_EDITOR_STYLES as r,DOOM_SYNTAX_STYLES as i}from"../lib/editorTheme.mjs";import{jsx as a}from"react/jsx-runtime";import{useEffect as o,useRef as s}from"react";import{defaultKeymap as c,history as l,historyKeymap as u,indentWithTab as d}from"@codemirror/commands";import{HighlightStyle as f,bracketMatching as p,foldGutter as m,foldKeymap as h,indentOnInput as g,syntaxHighlighting as _}from"@codemirror/language";import{highlightSelectionMatches as v,search as y,searchKeymap as b}from"@codemirror/search";import{Compartment as x,EditorState as S}from"@codemirror/state";import{EditorView as C,drawSelection as w,highlightActiveLine as T,highlightActiveLineGutter as E,keymap as D,lineNumbers as O,rectangularSelection as k}from"@codemirror/view";import{tags as A}from"@lezer/highlight";const j=C.theme(r),M=f.define([{tag:A.comment,...i.comment},{tag:A.keyword,...i.keyword},{tag:[A.atom,A.bool,A.null,A.self],...i.constant},{tag:A.number,...i.literal},{tag:[A.string,A.special(A.string),A.character],...i.string},{tag:A.regexp,...i.regexp},{tag:A.operator,...i.operator},{tag:A.punctuation,...i.punctuation},{tag:A.variableName,...i.variable},{tag:A.propertyName,...i.property},{tag:[A.function(A.variableName),A.function(A.propertyName)],...i.callable},{tag:[A.typeName,A.className,A.namespace],...i.type},{tag:A.tagName,...i.tag},{tag:A.attributeName,...i.attribute},{tag:[A.meta,A.processingInstruction],...i.meta},{tag:A.heading,...i.heading},{tag:[A.link,A.url],...i.link},{tag:A.emphasis,...i.emphasis},{tag:A.strong,...i.strong},{tag:A.strikethrough,...i.strikethrough},{tag:A.invalid,...i.invalid}]),N=[O(),E(),m(),T(),w(),k(),g(),p(),l(),y({top:!0}),v(),D.of([...c,...u,...b,...h,d]),_(M),j];function P({value:r,path:i,readOnly:c=!1,lineWrapping:l=!0,className:u,onChange:d,onSelect:f,"data-testid":p}){let m=s(null),h=s(null),g=s({onChange:d,onSelect:f}),_=s({language:new x,readOnly:new x,wrapping:new x});return o(()=>{g.current={onChange:d,onSelect:f}}),o(()=>{let e=m.current;if(e===null)return;let{language:t,readOnly:n,wrapping:
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{grammarKeyOf as t,loadGrammar as n}from"../lib/editorLanguage.mjs";import{DOOM_EDITOR_STYLES as r,DOOM_SYNTAX_STYLES as i}from"../lib/editorTheme.mjs";import{jsx as a}from"react/jsx-runtime";import{useEffect as o,useRef as s}from"react";import{defaultKeymap as c,history as l,historyKeymap as u,indentWithTab as d}from"@codemirror/commands";import{HighlightStyle as f,bracketMatching as p,foldGutter as m,foldKeymap as h,indentOnInput as g,syntaxHighlighting as _}from"@codemirror/language";import{highlightSelectionMatches as v,search as y,searchKeymap as b}from"@codemirror/search";import{Compartment as x,EditorState as S}from"@codemirror/state";import{EditorView as C,drawSelection as w,highlightActiveLine as T,highlightActiveLineGutter as E,keymap as D,lineNumbers as O,rectangularSelection as k}from"@codemirror/view";import{tags as A}from"@lezer/highlight";const j=C.theme(r),M=f.define([{tag:A.comment,...i.comment},{tag:A.keyword,...i.keyword},{tag:[A.atom,A.bool,A.null,A.self],...i.constant},{tag:A.number,...i.literal},{tag:[A.string,A.special(A.string),A.character],...i.string},{tag:A.regexp,...i.regexp},{tag:A.operator,...i.operator},{tag:A.punctuation,...i.punctuation},{tag:A.variableName,...i.variable},{tag:A.propertyName,...i.property},{tag:[A.function(A.variableName),A.function(A.propertyName)],...i.callable},{tag:[A.typeName,A.className,A.namespace],...i.type},{tag:A.tagName,...i.tag},{tag:A.attributeName,...i.attribute},{tag:[A.meta,A.processingInstruction],...i.meta},{tag:A.heading,...i.heading},{tag:[A.link,A.url],...i.link},{tag:A.emphasis,...i.emphasis},{tag:A.strong,...i.strong},{tag:A.strikethrough,...i.strikethrough},{tag:A.invalid,...i.invalid}]),N=[O(),E(),m(),T(),w(),k(),g(),p(),l(),y({top:!0}),v(),D.of([...c,...u,...b,...h,d]),_(M),j];function P({value:r,path:i,readOnly:c=!1,lineWrapping:l=!0,className:u,onChange:d,onSelect:f,"data-testid":p}){let m=s(null),h=s(null),g=s({onChange:d,onSelect:f}),_=s(r),v=s({language:new x,readOnly:new x,wrapping:new x});return o(()=>{g.current={onChange:d,onSelect:f}}),o(()=>{let e=m.current;if(e===null)return;let{language:t,readOnly:n,wrapping:r}=v.current,i=new C({parent:e,state:S.create({doc:_.current,extensions:[...N,t.of([]),n.of([]),r.of([]),C.updateListener.of(e=>{if(e.docChanged&&g.current.onChange?.(e.state.doc.toString()),!e.selectionSet&&!e.docChanged)return;let t=g.current.onSelect;if(t===void 0)return;let n=e.state.selection.main;t({text:e.state.sliceDoc(n.from,n.to),startLine:e.state.doc.lineAt(n.from).number,endLine:e.state.doc.lineAt(n.to).number})})]})});return h.current=i,()=>{i.destroy(),h.current=null}},[]),o(()=>{let e=h.current;e!==null&&e.state.doc.toString()!==r&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:r}})},[r]),o(()=>{h.current?.dispatch({effects:v.current.readOnly.reconfigure([S.readOnly.of(c),C.editable.of(!c)])})},[c]),o(()=>{h.current?.dispatch({effects:v.current.wrapping.reconfigure(l?C.lineWrapping:[])})},[l]),o(()=>{let e=i===void 0?void 0:t(i),{language:r}=v.current;if(e===void 0){h.current?.dispatch({effects:r.reconfigure([])});return}let a=!1;return n(e).then(e=>{a||h.current?.dispatch({effects:r.reconfigure(e)})}).catch(()=>{a||h.current?.dispatch({effects:r.reconfigure([])})}),()=>{a=!0}},[i]),a(`div`,{ref:m,"data-testid":p,className:e(`min-h-0 overflow-hidden`,u)})}export{P as CodeEditorView};
|
|
2
2
|
//# sourceMappingURL=CodeEditorView.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditorView.mjs","names":[],"sources":["../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState } from '@codemirror/state';\nimport {\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useRef } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage.ts';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme.ts';\nimport type { CodeEditorProps } from '../types/editor.ts';\n\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: value,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report({\n text: update.state.sliceDoc(range.from, range.to),\n startLine: update.state.doc.lineAt(range.from).number,\n endLine: update.state.doc.lineAt(range.to).number,\n });\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once. `value` seeds the document and the sync effect owns it after that.\n }, []);\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":"24BA0CA,MAAM,EAAa,EAAW,MAAM,CAAkB,EAEhD,EAAiB,EAAe,OAAO,CAC3C,CAAE,IAAK,EAAK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nF,CAAC,CAAC,CACD,UAAY,CAIN,GAAW,EAAK,SAAS,SAAS,CAAE,QAAS,EAAS,YAAY,CAAC,CAAC,CAAE,CAAC,CAC9E,CAAC,MACU,CACX,EAAY,EACd,CACF,EAAG,CAAC,CAAI,CAAC,EAEF,EAAC,MAAD,CAAK,IAAK,EAAM,cAAa,EAAQ,UAAW,EAAG,0BAA2B,CAAS,CAAI,CAAA,CACpG"}
|
|
1
|
+
{"version":3,"file":"CodeEditorView.mjs","names":[],"sources":["../../../src/components/CodeEditorView.tsx"],"sourcesContent":["import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';\nimport {\n bracketMatching,\n foldGutter,\n foldKeymap,\n HighlightStyle,\n indentOnInput,\n syntaxHighlighting,\n} from '@codemirror/language';\nimport { highlightSelectionMatches, search, searchKeymap } from '@codemirror/search';\nimport { Compartment, EditorState } from '@codemirror/state';\nimport {\n drawSelection,\n EditorView,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n rectangularSelection,\n} from '@codemirror/view';\nimport { tags } from '@lezer/highlight';\nimport { useEffect, useRef } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport { grammarKeyOf, loadGrammar } from '../lib/editorLanguage.ts';\nimport { DOOM_EDITOR_STYLES, DOOM_SYNTAX_STYLES } from '../lib/editorTheme.ts';\nimport type { CodeEditorProps } from '../types/editor.ts';\n\n/**\n * The editor itself, mounted on a real CodeMirror view.\n *\n * Nothing imports this module directly: `CodeEditor` reaches it through a lazy\n * import so the whole editor, and every grammar under it, stays out of the\n * cockpit's first load. Behaviour lives here rather than in that wrapper so\n * the split costs one file and no indirection.\n *\n * The three things a caller can change after mount each sit in their own\n * compartment. Reconfiguring one is a transaction; rebuilding the editor would\n * throw away the undo history, the scroll position and the cursor, which is\n * what a reader loses if a parent re-render is allowed to remount this.\n */\n\n/** Not a colour or a layout choice: how CodeMirror is told to draw the doom palette. */\nconst DOOM_THEME = EditorView.theme(DOOM_EDITOR_STYLES);\n\nconst DOOM_HIGHLIGHT = HighlightStyle.define([\n { tag: tags.comment, ...DOOM_SYNTAX_STYLES.comment },\n { tag: tags.keyword, ...DOOM_SYNTAX_STYLES.keyword },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], ...DOOM_SYNTAX_STYLES.constant },\n { tag: tags.number, ...DOOM_SYNTAX_STYLES.literal },\n { tag: [tags.string, tags.special(tags.string), tags.character], ...DOOM_SYNTAX_STYLES.string },\n { tag: tags.regexp, ...DOOM_SYNTAX_STYLES.regexp },\n { tag: tags.operator, ...DOOM_SYNTAX_STYLES.operator },\n { tag: tags.punctuation, ...DOOM_SYNTAX_STYLES.punctuation },\n { tag: tags.variableName, ...DOOM_SYNTAX_STYLES.variable },\n { tag: tags.propertyName, ...DOOM_SYNTAX_STYLES.property },\n { tag: [tags.function(tags.variableName), tags.function(tags.propertyName)], ...DOOM_SYNTAX_STYLES.callable },\n { tag: [tags.typeName, tags.className, tags.namespace], ...DOOM_SYNTAX_STYLES.type },\n { tag: tags.tagName, ...DOOM_SYNTAX_STYLES.tag },\n { tag: tags.attributeName, ...DOOM_SYNTAX_STYLES.attribute },\n { tag: [tags.meta, tags.processingInstruction], ...DOOM_SYNTAX_STYLES.meta },\n { tag: tags.heading, ...DOOM_SYNTAX_STYLES.heading },\n { tag: [tags.link, tags.url], ...DOOM_SYNTAX_STYLES.link },\n { tag: tags.emphasis, ...DOOM_SYNTAX_STYLES.emphasis },\n { tag: tags.strong, ...DOOM_SYNTAX_STYLES.strong },\n { tag: tags.strikethrough, ...DOOM_SYNTAX_STYLES.strikethrough },\n { tag: tags.invalid, ...DOOM_SYNTAX_STYLES.invalid },\n]);\n\n/** Everything that never changes for the life of an editor. */\nconst FIXED_EXTENSIONS = [\n lineNumbers(),\n highlightActiveLineGutter(),\n foldGutter(),\n highlightActiveLine(),\n drawSelection(),\n rectangularSelection(),\n indentOnInput(),\n bracketMatching(),\n history(),\n search({ top: true }),\n highlightSelectionMatches(),\n // Tab indents rather than leaving the editor. That trades a keyboard user's\n // escape route for the behaviour every other editor has, so it is last in\n // the keymap and Escape then Tab still moves focus out.\n keymap.of([...defaultKeymap, ...historyKeymap, ...searchKeymap, ...foldKeymap, indentWithTab]),\n syntaxHighlighting(DOOM_HIGHLIGHT),\n DOOM_THEME,\n];\n\nexport function CodeEditorView({\n value,\n path,\n readOnly = false,\n lineWrapping = true,\n className,\n onChange,\n onSelect,\n 'data-testid': testId,\n}: CodeEditorProps) {\n const host = useRef<HTMLDivElement>(null);\n const view = useRef<EditorView | null>(null);\n // The callbacks are new objects on every parent render. Reading them through\n // a ref is what lets the editor be built once and still call the current\n // pair, rather than being rebuilt whenever the parent re-renders.\n const handlers = useRef({ onChange, onSelect });\n // The document is seeded once from the value of the first render; the sync effect\n // below owns every later change.\n const initialValue = useRef(value);\n const compartments = useRef({\n language: new Compartment(),\n readOnly: new Compartment(),\n wrapping: new Compartment(),\n });\n\n useEffect(() => {\n handlers.current = { onChange, onSelect };\n });\n\n useEffect(() => {\n const parent = host.current;\n if (parent === null) return;\n const { language, readOnly: readOnlyPart, wrapping } = compartments.current;\n const editor = new EditorView({\n parent,\n state: EditorState.create({\n // The initial document only; every later change arrives as a\n // transaction from the effect below.\n doc: initialValue.current,\n extensions: [\n ...FIXED_EXTENSIONS,\n language.of([]),\n readOnlyPart.of([]),\n wrapping.of([]),\n EditorView.updateListener.of((update) => {\n if (update.docChanged) handlers.current.onChange?.(update.state.doc.toString());\n if (!update.selectionSet && !update.docChanged) return;\n const report = handlers.current.onSelect;\n if (report === undefined) return;\n const range = update.state.selection.main;\n report({\n text: update.state.sliceDoc(range.from, range.to),\n startLine: update.state.doc.lineAt(range.from).number,\n endLine: update.state.doc.lineAt(range.to).number,\n });\n }),\n ],\n }),\n });\n view.current = editor;\n return () => {\n editor.destroy();\n view.current = null;\n };\n // Built once.\n }, []);\n\n useEffect(() => {\n const editor = view.current;\n // A caller that echoes onChange back into `value` would otherwise replace\n // the document on every keystroke and drop the cursor to the end.\n if (editor === null || editor.state.doc.toString() === value) return;\n editor.dispatch({ changes: { from: 0, to: editor.state.doc.length, insert: value } });\n }, [value]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.readOnly.reconfigure([\n EditorState.readOnly.of(readOnly),\n EditorView.editable.of(!readOnly),\n ]),\n });\n }, [readOnly]);\n\n useEffect(() => {\n view.current?.dispatch({\n effects: compartments.current.wrapping.reconfigure(lineWrapping ? EditorView.lineWrapping : []),\n });\n }, [lineWrapping]);\n\n useEffect(() => {\n const key = path === undefined ? undefined : grammarKeyOf(path);\n const { language } = compartments.current;\n if (key === undefined) {\n view.current?.dispatch({ effects: language.reconfigure([]) });\n return;\n }\n let cancelled = false;\n void loadGrammar(key)\n .then((grammar) => {\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure(grammar) });\n })\n .catch(() => {\n // A grammar is a separate chunk over the network, and the cockpit is\n // often read through a tunnel. Losing it costs syntax colour, not the\n // file, so fall back to plain text rather than failing the pane.\n if (!cancelled) view.current?.dispatch({ effects: language.reconfigure([]) });\n });\n return () => {\n cancelled = true;\n };\n }, [path]);\n\n return <div ref={host} data-testid={testId} className={cn('min-h-0 overflow-hidden', className)} />;\n}\n"],"mappings":"24BA0CA,MAAM,EAAa,EAAW,MAAM,CAAkB,EAEhD,EAAiB,EAAe,OAAO,CAC3C,CAAE,IAAK,EAAK,QAAS,GAAG,EAAmB,OAAQ,EACnD,CAAE,IAAK,EAAK,QAAS,GAAG,EAAmB,OAAQ,EACnD,CAAE,IAAK,CAAC,EAAK,KAAM,EAAK,KAAM,EAAK,KAAM,EAAK,IAAI,EAAG,GAAG,EAAmB,QAAS,EACpF,CAAE,IAAK,EAAK,OAAQ,GAAG,EAAmB,OAAQ,EAClD,CAAE,IAAK,CAAC,EAAK,OAAQ,EAAK,QAAQ,EAAK,MAAM,EAAG,EAAK,SAAS,EAAG,GAAG,EAAmB,MAAO,EAC9F,CAAE,IAAK,EAAK,OAAQ,GAAG,EAAmB,MAAO,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//#region src/components/Collapsible.d.ts
|
|
4
4
|
/** A section that folds; Radix keeps the trigger's aria-expanded in step with the content. */
|
|
5
|
-
declare function Collapsible$1(props: ComponentProps<typeof Collapsible.Root>): import("react
|
|
6
|
-
declare function CollapsibleTrigger(props: ComponentProps<typeof Collapsible.CollapsibleTrigger>): import("react
|
|
7
|
-
declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof Collapsible.CollapsibleContent>): import("react
|
|
5
|
+
declare function Collapsible$1(props: ComponentProps<typeof Collapsible.Root>): import("react").JSX.Element;
|
|
6
|
+
declare function CollapsibleTrigger(props: ComponentProps<typeof Collapsible.CollapsibleTrigger>): import("react").JSX.Element;
|
|
7
|
+
declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof Collapsible.CollapsibleContent>): import("react").JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
10
10
|
//# sourceMappingURL=Collapsible.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collapsible.d.mts","names":[],"sources":["../../../src/components/Collapsible.tsx"],"mappings":";;;;iBAKgB,cAAY,OAAO,sBAAsB,YAAqB,
|
|
1
|
+
{"version":3,"file":"Collapsible.d.mts","names":[],"sources":["../../../src/components/Collapsible.tsx"],"mappings":";;;;iBAKgB,cAAY,OAAO,sBAAsB,YAAqB,wBAAK,IAAA;iBAInE,mBAAmB,OAAO,sBAAsB,YAAqB,sCAAmB,IAAA;iBAIxF,qBACd,cACG,SACF,sBAAsB,YAAqB,sCAAmB,IAAA"}
|
|
@@ -19,24 +19,24 @@ interface CommandDialogProps extends Omit<DialogContentProps, 'title'> {
|
|
|
19
19
|
title: ReactNode;
|
|
20
20
|
titleVisible?: boolean;
|
|
21
21
|
}
|
|
22
|
-
declare function CommandDialog({ open, onOpenChange, title, titleVisible, className, children, width, ...props }: CommandDialogProps): import("react
|
|
22
|
+
declare function CommandDialog({ open, onOpenChange, title, titleVisible, className, children, width, ...props }: CommandDialogProps): import("react").JSX.Element;
|
|
23
23
|
/** The strip the search field sits in. */
|
|
24
|
-
declare function CommandHeader({ className, ...props }: ComponentProps<'div'>): import("react
|
|
24
|
+
declare function CommandHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
25
25
|
/** The search field: bare, because the header already draws the surface. */
|
|
26
|
-
declare function CommandInput({ className, ...props }: InputProps): import("react
|
|
26
|
+
declare function CommandInput({ className, ...props }: InputProps): import("react").JSX.Element;
|
|
27
27
|
/** The scrolling body. It is the listbox, so its rows are the options. */
|
|
28
|
-
declare function CommandList({ className, ...props }: ComponentProps<'div'>): import("react
|
|
28
|
+
declare function CommandList({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
29
29
|
/** A labelled run of rows. */
|
|
30
|
-
declare function CommandGroup({ className, ...props }: ComponentProps<'div'>): import("react
|
|
31
|
-
declare function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>): import("react
|
|
30
|
+
declare function CommandGroup({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
31
|
+
declare function CommandGroupLabel({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
32
32
|
/** One command. Compact by default, since a palette shows many at once. */
|
|
33
|
-
declare function CommandItem({ density, ...props }: OptionRowProps): import("react
|
|
33
|
+
declare function CommandItem({ density, ...props }: OptionRowProps): import("react").JSX.Element;
|
|
34
34
|
/** A command's name, taking the width the row has left. */
|
|
35
|
-
declare function CommandItemLabel(props: ComponentProps<'span'>): import("react
|
|
35
|
+
declare function CommandItemLabel(props: ComponentProps<'span'>): import("react").JSX.Element;
|
|
36
36
|
/** What the palette says when nothing matches. */
|
|
37
|
-
declare function CommandEmpty({ className, ...props }: ComponentProps<'div'>): import("react
|
|
37
|
+
declare function CommandEmpty({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
38
38
|
/** The hint strip along the bottom: what the keys do. */
|
|
39
|
-
declare function CommandFooter({ className, ...props }: ComponentProps<'div'>): import("react
|
|
39
|
+
declare function CommandFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { CommandDialog, CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandHeader, CommandInput, CommandItem, CommandItemLabel, CommandList };
|
|
42
42
|
//# sourceMappingURL=Command.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.d.mts","names":[],"sources":["../../../src/components/Command.tsx"],"mappings":";;;;;;;;;;;;;;UAgBiB,2BAA2B,KAAK;EAC/C;EACA,eAAe;;EAEf,OAAO;EACP;;iBAGc,gBACd,MACA,cACA,OACA,cACA,WACA,UACA,UACG,SACF,
|
|
1
|
+
{"version":3,"file":"Command.d.mts","names":[],"sources":["../../../src/components/Command.tsx"],"mappings":";;;;;;;;;;;;;;UAgBiB,2BAA2B,KAAK;EAC/C;EACA,eAAe;;EAEf,OAAO;EACP;;iBAGc,gBACd,MACA,cACA,OACA,cACA,WACA,UACA,UACG,SACF,qCAAkB,IAAA;;iBAYL,gBAAgB,cAAc,SAAS,wCAAqB,IAAA;;iBAW5D,eAAe,cAAc,SAAS,6BAAU,IAAA;;iBAchD,cAAc,cAAc,SAAS,wCAAqB,IAAA;;iBAY1D,eAAe,cAAc,SAAS,wCAAqB,IAAA;iBAI3D,oBAAoB,cAAc,SAAS,wCAAqB,IAAA;;iBAWhE,cAAc,YAAwB,SAAS,iCAAc,IAAA;;iBAK7D,iBAAiB,OAAO,yCAAsB,IAAA;;iBAK9C,eAAe,cAAc,SAAS,wCAAqB,IAAA;;iBAW3D,gBAAgB,cAAc,SAAS,wCAAqB,IAAA"}
|
|
@@ -6,14 +6,14 @@ import { ComponentProps } from "react";
|
|
|
6
6
|
* shadcn's Dialog on Radix: focus trap, Escape, outside click, scroll lock,
|
|
7
7
|
* and focus restored to the trigger on close. The frame is the Doom panel.
|
|
8
8
|
*/
|
|
9
|
-
declare function Dialog$1(props: ComponentProps<typeof Dialog.Root>): import("react
|
|
10
|
-
declare function DialogTrigger(props: ComponentProps<typeof Dialog.Trigger>): import("react
|
|
11
|
-
declare function DialogClose(props: ComponentProps<typeof Dialog.Close>): import("react
|
|
9
|
+
declare function Dialog$1(props: ComponentProps<typeof Dialog.Root>): import("react").JSX.Element;
|
|
10
|
+
declare function DialogTrigger(props: ComponentProps<typeof Dialog.Trigger>): import("react").JSX.Element;
|
|
11
|
+
declare function DialogClose(props: ComponentProps<typeof Dialog.Close>): import("react").JSX.Element;
|
|
12
12
|
interface DialogContentProps extends ComponentProps<typeof Dialog.Content> {
|
|
13
13
|
/** Width preset; `className` may still override. */
|
|
14
14
|
width?: 'sm' | 'md' | 'lg';
|
|
15
15
|
}
|
|
16
|
-
declare function DialogContent({ className, children, width, ...props }: DialogContentProps): import("react
|
|
16
|
+
declare function DialogContent({ className, children, width, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
17
17
|
interface DialogHeaderProps extends ComponentProps<'div'> {
|
|
18
18
|
/**
|
|
19
19
|
* Show the close control at the right of the strip. Off by default: most
|
|
@@ -25,15 +25,15 @@ interface DialogHeaderProps extends ComponentProps<'div'> {
|
|
|
25
25
|
/** What the close control announces. */
|
|
26
26
|
closeLabel?: string;
|
|
27
27
|
}
|
|
28
|
-
declare function DialogHeader({ className, dismissible, closeLabel, children, ...props }: DialogHeaderProps): import("react
|
|
29
|
-
declare function DialogTitle({ className, ...props }: ComponentProps<typeof Dialog.Title>): import("react
|
|
30
|
-
declare function DialogDescription({ className, ...props }: ComponentProps<typeof Dialog.Description>): import("react
|
|
31
|
-
declare function DialogBody({ className, ...props }: ComponentProps<'div'>): import("react
|
|
28
|
+
declare function DialogHeader({ className, dismissible, closeLabel, children, ...props }: DialogHeaderProps): import("react").JSX.Element;
|
|
29
|
+
declare function DialogTitle({ className, ...props }: ComponentProps<typeof Dialog.Title>): import("react").JSX.Element;
|
|
30
|
+
declare function DialogDescription({ className, ...props }: ComponentProps<typeof Dialog.Description>): import("react").JSX.Element;
|
|
31
|
+
declare function DialogBody({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
32
32
|
declare const dialogFooterVariants: (props?: ({
|
|
33
33
|
variant?: "bar" | "plain" | null | undefined;
|
|
34
34
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
35
35
|
interface DialogFooterProps extends ComponentProps<'div'>, VariantProps<typeof dialogFooterVariants> {}
|
|
36
|
-
declare function DialogFooter({ className, variant, ...props }: DialogFooterProps): import("react
|
|
36
|
+
declare function DialogFooter({ className, variant, ...props }: DialogFooterProps): import("react").JSX.Element;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { Dialog$1 as Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogTitle, DialogTrigger, dialogFooterVariants };
|
|
39
39
|
//# sourceMappingURL=Dialog.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../../src/components/Dialog.tsx"],"mappings":";;;;;;;;iBAWgB,SAAO,OAAO,sBAAsB,OAAgB,
|
|
1
|
+
{"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../../src/components/Dialog.tsx"],"mappings":";;;;;;;;iBAWgB,SAAO,OAAO,sBAAsB,OAAgB,wBAAK,IAAA;iBAIzD,cAAc,OAAO,sBAAsB,OAAgB,2BAAQ,IAAA;iBAQnE,YAAY,OAAO,sBAAsB,OAAgB,yBAAM,IAAA;UAc9D,2BAA2B,sBAAsB,OAAgB;;EAEhF;;iBAKc,gBAAgB,WAAW,UAAU,UAAiB,SAAS,qCAAkB,IAAA;UAmBhF,0BAA0B;;;;;;;EAOzC;;EAEA;;iBAGc,eACd,WACA,aACA,YACA,aACG,SACF,oCAAiB,IAAA;iBAsBJ,cAAc,cAAc,SAAS,sBAAsB,OAAgB,yBAAM,IAAA;iBAUjF,oBAAoB,cAAc,SAAS,sBAAsB,OAAgB,+BAAY,IAAA;iBAU7F,aAAa,cAAc,SAAS,wCAAqB,IAAA;cAU5D,uBAAoB;;6CAc/B;UAEe,0BAA0B,uBAAuB,oBAAoB;iBAEtE,eAAe,WAAW,YAAY,SAAS,oCAAiB,IAAA"}
|
|
@@ -10,7 +10,7 @@ declare const dotVariants: (props?: ({
|
|
|
10
10
|
type DotTone = DotTone$1;
|
|
11
11
|
interface DotProps extends ComponentProps<'span'>, VariantProps<typeof dotVariants> {}
|
|
12
12
|
/** The status dot: a colour and, while something is live, a pulse. */
|
|
13
|
-
declare function Dot({ className, tone, size, pulse, ...props }: DotProps): import("react
|
|
13
|
+
declare function Dot({ className, tone, size, pulse, ...props }: DotProps): import("react").JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Dot, DotProps, DotTone, dotVariants };
|
|
16
16
|
//# sourceMappingURL=Dot.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dot.d.mts","names":[],"sources":["../../../src/components/Dot.tsx"],"mappings":";;;;cAKa,cAAW;;;;6CA2BtB;KAEU,UAAU;UAEL,iBAAiB,wBAAwB,oBAAoB;;iBAG9D,MAAM,WAAW,MAAM,MAAM,UAAU,SAAS,
|
|
1
|
+
{"version":3,"file":"Dot.d.mts","names":[],"sources":["../../../src/components/Dot.tsx"],"mappings":";;;;cAKa,cAAW;;;;6CA2BtB;KAEU,UAAU;UAEL,iBAAiB,wBAAwB,oBAAoB;;iBAG9D,MAAM,WAAW,MAAM,MAAM,UAAU,SAAS,2BAAQ,IAAA"}
|
|
@@ -3,32 +3,32 @@ import { VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
//#region src/components/DropdownMenu.d.ts
|
|
5
5
|
/** shadcn's DropdownMenu on Radix: roving focus, typeahead, outside click, Escape. */
|
|
6
|
-
declare function DropdownMenu$1(props: ComponentProps<typeof DropdownMenu.Root>): import("react
|
|
7
|
-
declare function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenu.Trigger>): import("react
|
|
6
|
+
declare function DropdownMenu$1(props: ComponentProps<typeof DropdownMenu.Root>): import("react").JSX.Element;
|
|
7
|
+
declare function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenu.Trigger>): import("react").JSX.Element;
|
|
8
8
|
/** A run of items under one label, so the separator between groups is structural. */
|
|
9
|
-
declare function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenu.Group>): import("react
|
|
10
|
-
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: ComponentProps<typeof DropdownMenu.Content>): import("react
|
|
9
|
+
declare function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenu.Group>): import("react").JSX.Element;
|
|
10
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: ComponentProps<typeof DropdownMenu.Content>): import("react").JSX.Element;
|
|
11
11
|
declare const dropdownMenuItemVariants: (props?: ({
|
|
12
12
|
variant?: "default" | "destructive" | null | undefined;
|
|
13
13
|
indented?: boolean | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
15
|
interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenu.Item>, VariantProps<typeof dropdownMenuItemVariants> {}
|
|
16
|
-
declare function DropdownMenuItem({ className, variant, indented, ...props }: DropdownMenuItemProps): import("react
|
|
16
|
+
declare function DropdownMenuItem({ className, variant, indented, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
17
17
|
interface DropdownMenuCheckboxItemProps extends ComponentProps<typeof DropdownMenu.CheckboxItem>, VariantProps<typeof dropdownMenuItemVariants> {}
|
|
18
18
|
/** A row that toggles: the check lives in the gutter so the label never shifts. */
|
|
19
|
-
declare function DropdownMenuCheckboxItem({ className, variant, children, ...props }: DropdownMenuCheckboxItemProps): import("react
|
|
19
|
+
declare function DropdownMenuCheckboxItem({ className, variant, children, ...props }: DropdownMenuCheckboxItemProps): import("react").JSX.Element;
|
|
20
20
|
/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */
|
|
21
|
-
declare function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenu.RadioGroup>): import("react
|
|
21
|
+
declare function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenu.RadioGroup>): import("react").JSX.Element;
|
|
22
22
|
interface DropdownMenuRadioItemProps extends ComponentProps<typeof DropdownMenu.RadioItem>, VariantProps<typeof dropdownMenuItemVariants> {}
|
|
23
|
-
declare function DropdownMenuRadioItem({ className, variant, children, ...props }: DropdownMenuRadioItemProps): import("react
|
|
24
|
-
declare function DropdownMenuSub(props: ComponentProps<typeof DropdownMenu.Sub>): import("react
|
|
23
|
+
declare function DropdownMenuRadioItem({ className, variant, children, ...props }: DropdownMenuRadioItemProps): import("react").JSX.Element;
|
|
24
|
+
declare function DropdownMenuSub(props: ComponentProps<typeof DropdownMenu.Sub>): import("react").JSX.Element;
|
|
25
25
|
/** The row that opens a submenu; the chevron is part of the row, not the caller's job. */
|
|
26
|
-
declare function DropdownMenuSubTrigger({ className, children, ...props }: ComponentProps<typeof DropdownMenu.SubTrigger>): import("react
|
|
27
|
-
declare function DropdownMenuSubContent({ className, sideOffset, ...props }: ComponentProps<typeof DropdownMenu.SubContent>): import("react
|
|
28
|
-
declare function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof DropdownMenu.Label>): import("react
|
|
26
|
+
declare function DropdownMenuSubTrigger({ className, children, ...props }: ComponentProps<typeof DropdownMenu.SubTrigger>): import("react").JSX.Element;
|
|
27
|
+
declare function DropdownMenuSubContent({ className, sideOffset, ...props }: ComponentProps<typeof DropdownMenu.SubContent>): import("react").JSX.Element;
|
|
28
|
+
declare function DropdownMenuLabel({ className, ...props }: ComponentProps<typeof DropdownMenu.Label>): import("react").JSX.Element;
|
|
29
29
|
/** The keystroke printed at the right of a row; the row supplies the gap. */
|
|
30
|
-
declare function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>): import("react
|
|
31
|
-
declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenu.Separator>): import("react
|
|
30
|
+
declare function DropdownMenuShortcut({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
|
|
31
|
+
declare function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenu.Separator>): import("react").JSX.Element;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { DropdownMenu$1 as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, dropdownMenuItemVariants };
|
|
34
34
|
//# sourceMappingURL=DropdownMenu.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.mts","names":[],"sources":["../../../src/components/DropdownMenu.tsx"],"mappings":";;;;;iBAOgB,eAAa,OAAO,sBAAsB,aAAsB,
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.mts","names":[],"sources":["../../../src/components/DropdownMenu.tsx"],"mappings":";;;;;iBAOgB,eAAa,OAAO,sBAAsB,aAAsB,wBAAK,IAAA;iBAIrE,oBAAoB,OAAO,sBAAsB,aAAsB,2BAAQ,IAAA;;iBAK/E,kBAAkB,OAAO,sBAAsB,aAAsB,yBAAM,IAAA;iBAQ3E,sBACd,WACA,OACA,eACG,SACF,sBAAsB,aAAsB,2BAAQ,IAAA;cAc1C,2BAAwB;;;6CAapC;UAEgB,8BACP,sBAAsB,aAAsB,OAAO,oBAAoB;iBAEjE,mBAAmB,WAAW,SAAS,aAAa,SAAS,wCAAqB,IAAA;UAoBjF,sCACP,sBAAsB,aAAsB,eAAe,oBAAoB;;iBAGzE,2BAA2B,WAAW,SAAS,aAAa,SAAS,gDAA6B,IAAA;;iBAgBlG,uBAAuB,OAAO,sBAAsB,aAAsB,8BAAW,IAAA;UAIpF,mCACP,sBAAsB,aAAsB,YAAY,oBAAoB;iBAEtE,wBAAwB,WAAW,SAAS,aAAa,SAAS,6CAA0B,IAAA;iBAe5F,gBAAgB,OAAO,sBAAsB,aAAsB,uBAAI,IAAA;;iBAKvE,yBACd,WACA,aACG,SACF,sBAAsB,aAAsB,8BAAW,IAAA;iBAa1C,yBACd,WACA,eACG,SACF,sBAAsB,aAAsB,8BAAW,IAAA;iBAa1C,oBAAoB,cAAc,SAAS,sBAAsB,aAAsB,yBAAM,IAAA;;iBAW7F,uBAAuB,cAAc,SAAS,yCAAsB,IAAA;iBAUpE,wBAAwB,cAAc,SAAS,sBAAsB,aAAsB,6BAAU,IAAA"}
|
|
@@ -12,7 +12,7 @@ interface EmptyStateProps extends Omit<ComponentProps<'div'>, 'title'> {
|
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/** The centred "nothing here yet" card every empty panel shares. */
|
|
15
|
-
declare function EmptyState({ title, description, children, className, asChild, ...props }: EmptyStateProps): import("react
|
|
15
|
+
declare function EmptyState({ title, description, children, className, asChild, ...props }: EmptyStateProps): import("react").JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { EmptyState, EmptyStateProps };
|
|
18
18
|
//# sourceMappingURL=EmptyState.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.mts","names":[],"sources":["../../../src/components/EmptyState.tsx"],"mappings":";;UAIiB,wBAAwB,KAAK;EAC5C,OAAO;EACP,cAAc;;EAEd,WAAW;;;;;EAKX;;;iBAIc,aAAa,OAAO,aAAa,UAAU,WAAW,YAAoB,SAAS,
|
|
1
|
+
{"version":3,"file":"EmptyState.d.mts","names":[],"sources":["../../../src/components/EmptyState.tsx"],"mappings":";;UAIiB,wBAAwB,KAAK;EAC5C,OAAO;EACP,cAAc;;EAEd,WAAW;;;;;EAKX;;;iBAIc,aAAa,OAAO,aAAa,UAAU,WAAW,YAAoB,SAAS,kCAAe,IAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");function n({className:n,lines:r,gutter:i,...a}){let o={width:`${i}ch`};return(0,t.jsx)(`div`,{"data-slot":`hashline-lines`,className:e.cn(`flex flex-col font-mono`,n),...a,children:r.map((e,n)=>{if(e.type===`file`)return(0,t.jsx)(`span`,{className:`mt-1 truncate text-doom-faint first:mt-0`,children:e.path},n);if(e.type===`plain`)return(0,t.jsx)(`span`,{className:`whitespace-pre-wrap break-words text-doom-dim`,children:e.text},n);let{value:r}=e;return(0,t.jsxs)(`span`,{className:`flex gap-2`,children:[r.marker===void 0?null:(0,t.jsx)(`span`,{className:`w-4 shrink-0 ${r.marker===`match`?`text-doom-blue`:`text-doom-faint`}`,children:r.marker===`match`?`>>`:``}),(0,t.jsx)(`span`,{className:`shrink-0 text-right text-doom-faint`,style:o,children:r.line}),(0,t.jsx)(`span`,{className:`min-w-0 whitespace-pre-wrap break-words ${r.marker===`match`?`text-doom-hi`:`text-doom-text`}`,children:r.content})]},n)})})}exports.HashlineLines=n;
|
|
2
|
+
//# sourceMappingURL=HashlineLines.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HashlineLines.cjs","names":["cn"],"sources":["../../../src/components/HashlineLines.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cn } from '../lib/cn.ts';\nimport type { PresentedLine } from '../lib/hashlineView.ts';\n\n/**\n * The anchored body shared by hashline results: a file heading per group, a\n * right-aligned line-number gutter, and a `>>` marker on grep matches. The\n * gutter width is a style, not a class, because it follows the widest number.\n */\nexport interface HashlineLinesProps extends ComponentProps<'div'> {\n lines: readonly PresentedLine[];\n /** Width of the line-number column, in characters, from `hashlineBody`. */\n gutter: number;\n}\n\nexport function HashlineLines({ className, lines, gutter, ...props }: HashlineLinesProps) {\n // Bound to a name rather than written inline: this file ships as a scaffold\n // template too, and an inline style object opens with the same two braces\n // Liquid reads as an output tag, which fails to render.\n const gutterStyle = { width: `${gutter}ch` };\n return (\n <div data-slot=\"hashline-lines\" className={cn('flex flex-col font-mono', className)} {...props}>\n {lines.map((line, index) => {\n if (line.type === 'file') {\n return (\n <span key={index} className=\"mt-1 truncate text-doom-faint first:mt-0\">\n {line.path}\n </span>\n );\n }\n if (line.type === 'plain') {\n return (\n <span key={index} className=\"whitespace-pre-wrap break-words text-doom-dim\">\n {line.text}\n </span>\n );\n }\n const { value } = line;\n return (\n <span key={index} className=\"flex gap-2\">\n {value.marker !== undefined ? (\n <span className={`w-4 shrink-0 ${value.marker === 'match' ? 'text-doom-blue' : 'text-doom-faint'}`}>\n {value.marker === 'match' ? '>>' : ''}\n </span>\n ) : null}\n <span className=\"shrink-0 text-right text-doom-faint\" style={gutterStyle}>\n {value.line}\n </span>\n <span\n className={`min-w-0 whitespace-pre-wrap break-words ${value.marker === 'match' ? 'text-doom-hi' : 'text-doom-text'}`}\n >\n {value.content}\n </span>\n </span>\n );\n })}\n </div>\n );\n}\n"],"mappings":"oEAeA,SAAgB,EAAc,CAAE,YAAW,QAAO,SAAQ,GAAG,GAA6B,CAIxF,IAAM,EAAc,CAAE,MAAO,GAAG,EAAO,GAAI,EAC3C,OACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,YAAU,iBAAiB,UAAWA,EAAAA,GAAG,0BAA2B,CAAS,EAAG,GAAI,EACtF,SAAA,EAAM,KAAK,EAAM,IAAU,CAC1B,GAAI,EAAK,OAAS,OAChB,OACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAkB,UAAU,2CACzB,SAAA,EAAK,IACF,EAFK,CAEL,EAGV,GAAI,EAAK,OAAS,QAChB,OACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAkB,UAAU,gDACzB,SAAA,EAAK,IACF,EAFK,CAEL,EAGV,GAAM,CAAE,SAAU,EAClB,OACE,EAAA,EAAA,KAAA,CAAC,OAAD,CAAkB,UAAU,aAA5B,SAAA,CACG,EAAM,SAAW,IAAA,GAId,MAHF,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,gBAAgB,EAAM,SAAW,QAAU,iBAAmB,oBAC5E,SAAA,EAAM,SAAW,QAAU,KAAO,EAC/B,CAAA,GAER,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sCAAsC,MAAO,EAC1D,SAAA,EAAM,IACH,CAAA,GACN,EAAA,EAAA,IAAA,CAAC,OAAD,CACE,UAAW,2CAA2C,EAAM,SAAW,QAAU,eAAiB,mBAEjG,SAAA,EAAM,OACH,CAAA,CACF,CAdK,EAAA,CAcL,CAEV,CAAC,CACE,CAAA,CAET"}
|