@nadicodeai/ui 12.1.18 → 12.1.20
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/dist/components/command.js +1 -1
- package/dist/components/context-menu.d.ts +14 -22
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +29 -26
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +2 -1
- package/dist/components/file-diff.d.ts +12 -0
- package/dist/components/file-diff.d.ts.map +1 -0
- package/dist/components/file-diff.js +19 -0
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +3 -2
- package/dist/components/table-card.d.ts +13 -0
- package/dist/components/table-card.d.ts.map +1 -0
- package/dist/components/table-card.js +10 -0
- package/dist/components/table-layouts.d.ts +6 -0
- package/dist/components/table-layouts.d.ts.map +1 -1
- package/dist/components/table-layouts.js +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/internal/footer-strip.d.ts +12 -0
- package/dist/internal/footer-strip.d.ts.map +1 -0
- package/dist/internal/footer-strip.js +13 -0
- package/dist/internal/menu-surface.d.ts +6 -0
- package/dist/internal/menu-surface.d.ts.map +1 -0
- package/dist/internal/menu-surface.js +5 -0
- package/dist/lib/line-diff.d.ts +15 -0
- package/dist/lib/line-diff.d.ts.map +1 -0
- package/dist/lib/line-diff.js +136 -0
- package/package.json +2 -2
|
@@ -27,7 +27,7 @@ function CommandSeparator({ className, ...props }) {
|
|
|
27
27
|
return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn("-mx-1 h-px bg-border", className), ...props }));
|
|
28
28
|
}
|
|
29
29
|
function CommandItem({ className, children, ...props }) {
|
|
30
|
-
return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("group/command-item relative flex min-h-touch-target cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
|
|
30
|
+
return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("group/command-item relative flex min-h-touch-target cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
|
|
31
31
|
}
|
|
32
32
|
function CommandShortcut({ className, ...props }) {
|
|
33
33
|
return (_jsx("span", { "data-slot": "command-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", className), ...props }));
|
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
3
|
+
import { DropdownMenuCheckboxItem, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger } from "./dropdown-menu.js";
|
|
3
4
|
declare function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props): React.JSX.Element;
|
|
4
5
|
declare function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props): React.JSX.Element;
|
|
5
6
|
declare function ContextMenuTrigger({ className, ...props }: ContextMenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
-
declare function ContextMenuContent({ className, align, alignOffset, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">
|
|
7
|
-
|
|
8
|
-
declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuPrimitive.GroupLabel.Props & {
|
|
9
|
-
inset?: boolean;
|
|
7
|
+
declare function ContextMenuContent({ className, align, alignOffset, density, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset"> & {
|
|
8
|
+
density?: "compact" | "comfortable";
|
|
10
9
|
}): React.JSX.Element;
|
|
11
|
-
declare function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare function
|
|
16
|
-
declare function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare function
|
|
20
|
-
declare function
|
|
21
|
-
|
|
22
|
-
}): React.JSX.Element;
|
|
23
|
-
declare function ContextMenuRadioGroup({ ...props }: ContextMenuPrimitive.RadioGroup.Props): React.JSX.Element;
|
|
24
|
-
declare function ContextMenuRadioItem({ className, children, inset, ...props }: ContextMenuPrimitive.RadioItem.Props & {
|
|
25
|
-
inset?: boolean;
|
|
26
|
-
}): React.JSX.Element;
|
|
27
|
-
declare function ContextMenuSeparator({ className, ...props }: ContextMenuPrimitive.Separator.Props): React.JSX.Element;
|
|
28
|
-
declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
|
+
declare function ContextMenuGroup(props: React.ComponentProps<typeof DropdownMenuGroup>): React.JSX.Element;
|
|
11
|
+
declare function ContextMenuLabel(props: React.ComponentProps<typeof DropdownMenuLabel>): React.JSX.Element;
|
|
12
|
+
declare function ContextMenuItem(props: React.ComponentProps<typeof DropdownMenuItem>): React.JSX.Element;
|
|
13
|
+
declare function ContextMenuSub(props: React.ComponentProps<typeof DropdownMenuSub>): React.JSX.Element;
|
|
14
|
+
declare function ContextMenuSubTrigger(props: React.ComponentProps<typeof DropdownMenuSubTrigger>): React.JSX.Element;
|
|
15
|
+
declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuContent>): React.JSX.Element;
|
|
16
|
+
declare function ContextMenuCheckboxItem(props: React.ComponentProps<typeof DropdownMenuCheckboxItem>): React.JSX.Element;
|
|
17
|
+
declare function ContextMenuRadioGroup(props: React.ComponentProps<typeof DropdownMenuRadioGroup>): React.JSX.Element;
|
|
18
|
+
declare function ContextMenuRadioItem(props: React.ComponentProps<typeof DropdownMenuRadioItem>): React.JSX.Element;
|
|
19
|
+
declare function ContextMenuSeparator(props: React.ComponentProps<typeof DropdownMenuSeparator>): React.JSX.Element;
|
|
20
|
+
declare function ContextMenuShortcut(props: React.ComponentProps<typeof DropdownMenuShortcut>): React.JSX.Element;
|
|
29
21
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
30
22
|
//# sourceMappingURL=context-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,K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AC,OAAO,eAAe,CAAC,qBAE1E;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,sBAAsB,CAAC,qBAExF;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,qBASjD;AAED,iBAAS,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,wBAAwB,CAAC,qBAE5F;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,sBAAsB,CAAC,qBAExF;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,qBAEtF;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,qBAEtF;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,qBAEpF;AAED,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
import { anchoredOverlayMotion } from "../lib/motion.js";
|
|
6
|
-
import {
|
|
6
|
+
import { menuSurface } from "../internal/menu-surface.js";
|
|
7
|
+
import { DropdownMenuCheckboxItem, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, } from "./dropdown-menu.js";
|
|
8
|
+
// A context menu's items are Base UI's menu items, so every part below the popup is the dropdown's own: the two
|
|
9
|
+
// menus cannot drift apart in their rows, only in how they open.
|
|
7
10
|
function ContextMenu({ ...props }) {
|
|
8
11
|
return _jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
9
12
|
}
|
|
@@ -13,40 +16,40 @@ function ContextMenuPortal({ ...props }) {
|
|
|
13
16
|
function ContextMenuTrigger({ className, ...props }) {
|
|
14
17
|
return (_jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", className: cn("select-none", className), ...props }));
|
|
15
18
|
}
|
|
16
|
-
function ContextMenuContent({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) {
|
|
17
|
-
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(ContextMenuPrimitive.Popup, { "data-slot": "context-menu-content", className: cn(
|
|
19
|
+
function ContextMenuContent({ className, align = "start", alignOffset = 4, density = "comfortable", side = "right", sideOffset = 0, ...props }) {
|
|
20
|
+
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, collisionPadding: 8, children: _jsx(ContextMenuPrimitive.Popup, { "data-slot": "context-menu-content", "data-density": density, className: cn(menuSurface, anchoredOverlayMotion, className), ...props }) }) }));
|
|
18
21
|
}
|
|
19
|
-
function ContextMenuGroup(
|
|
20
|
-
return _jsx(
|
|
22
|
+
function ContextMenuGroup(props) {
|
|
23
|
+
return _jsx(DropdownMenuGroup, { "data-slot": "context-menu-group", ...props });
|
|
21
24
|
}
|
|
22
|
-
function ContextMenuLabel(
|
|
23
|
-
return
|
|
25
|
+
function ContextMenuLabel(props) {
|
|
26
|
+
return _jsx(DropdownMenuLabel, { "data-slot": "context-menu-label", ...props });
|
|
24
27
|
}
|
|
25
|
-
function ContextMenuItem(
|
|
26
|
-
return
|
|
28
|
+
function ContextMenuItem(props) {
|
|
29
|
+
return _jsx(DropdownMenuItem, { "data-slot": "context-menu-item", ...props });
|
|
27
30
|
}
|
|
28
|
-
function ContextMenuSub(
|
|
29
|
-
return _jsx(
|
|
31
|
+
function ContextMenuSub(props) {
|
|
32
|
+
return _jsx(DropdownMenuSub, { "data-slot": "context-menu-sub", ...props });
|
|
30
33
|
}
|
|
31
|
-
function ContextMenuSubTrigger(
|
|
32
|
-
return (
|
|
34
|
+
function ContextMenuSubTrigger(props) {
|
|
35
|
+
return _jsx(DropdownMenuSubTrigger, { "data-slot": "context-menu-sub-trigger", ...props });
|
|
33
36
|
}
|
|
34
|
-
function ContextMenuSubContent({ ...props }) {
|
|
35
|
-
return (_jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: "min-w-24", side: "right", ...props }));
|
|
37
|
+
function ContextMenuSubContent({ className, ...props }) {
|
|
38
|
+
return (_jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: cn("w-auto min-w-24", className), side: "right", ...props }));
|
|
36
39
|
}
|
|
37
|
-
function ContextMenuCheckboxItem(
|
|
38
|
-
return (
|
|
40
|
+
function ContextMenuCheckboxItem(props) {
|
|
41
|
+
return _jsx(DropdownMenuCheckboxItem, { "data-slot": "context-menu-checkbox-item", ...props });
|
|
39
42
|
}
|
|
40
|
-
function ContextMenuRadioGroup(
|
|
41
|
-
return _jsx(
|
|
43
|
+
function ContextMenuRadioGroup(props) {
|
|
44
|
+
return _jsx(DropdownMenuRadioGroup, { "data-slot": "context-menu-radio-group", ...props });
|
|
42
45
|
}
|
|
43
|
-
function ContextMenuRadioItem(
|
|
44
|
-
return (
|
|
46
|
+
function ContextMenuRadioItem(props) {
|
|
47
|
+
return _jsx(DropdownMenuRadioItem, { "data-slot": "context-menu-radio-item", ...props });
|
|
45
48
|
}
|
|
46
|
-
function ContextMenuSeparator(
|
|
47
|
-
return
|
|
49
|
+
function ContextMenuSeparator(props) {
|
|
50
|
+
return _jsx(DropdownMenuSeparator, { "data-slot": "context-menu-separator", ...props });
|
|
48
51
|
}
|
|
49
|
-
function ContextMenuShortcut(
|
|
50
|
-
return
|
|
52
|
+
function ContextMenuShortcut(props) {
|
|
53
|
+
return _jsx(DropdownMenuShortcut, { "data-slot": "context-menu-shortcut", ...props });
|
|
51
54
|
}
|
|
52
55
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAO5D,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,qBAE3D;AAED,iBAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,MAAM,CAA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AAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { anchoredOverlayMotion } from "../lib/motion.js";
|
|
5
|
+
import { menuSurface } from "../internal/menu-surface.js";
|
|
5
6
|
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
6
7
|
function DropdownMenu({ ...props }) {
|
|
7
8
|
return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
@@ -13,7 +14,7 @@ function DropdownMenuTrigger({ ...props }) {
|
|
|
13
14
|
return _jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
14
15
|
}
|
|
15
16
|
function DropdownMenuContent({ align = "start", alignOffset = 0, density = "comfortable", side = "bottom", sideOffset = 6, className, ...props }) {
|
|
16
|
-
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, collisionPadding: 8, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", "data-density": density, className: cn(
|
|
17
|
+
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, collisionPadding: 8, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", "data-density": density, className: cn(menuSurface, anchoredOverlayMotion, className), ...props }) }) }));
|
|
17
18
|
}
|
|
18
19
|
function DropdownMenuGroup({ ...props }) {
|
|
19
20
|
return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface FileDiffProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
2
|
+
addedLabel?: string;
|
|
3
|
+
after: string;
|
|
4
|
+
before: string;
|
|
5
|
+
/** Unchanged lines kept on each side of a change; the rest fold into one marker. */
|
|
6
|
+
context?: number;
|
|
7
|
+
removedLabel?: string;
|
|
8
|
+
skippedLabel?: (count: number) => string;
|
|
9
|
+
}
|
|
10
|
+
declare function FileDiff({ addedLabel, after, before, className, context, removedLabel, skippedLabel, ...props }: FileDiffProps): import("react").JSX.Element;
|
|
11
|
+
export { FileDiff };
|
|
12
|
+
//# sourceMappingURL=file-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-diff.d.ts","sourceRoot":"","sources":["../../src/components/file-diff.tsx"],"names":[],"mappings":"AAKA,UAAU,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1C;AAcD,iBAAS,QAAQ,CAAC,EAChB,UAAoB,EACpB,KAAK,EACL,MAAM,EACN,SAAS,EACT,OAAW,EACX,YAAwB,EACxB,YAAoD,EACpD,GAAG,KAAK,EACT,EAAE,aAAa,+BAkCf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { lineDiff } from "../lib/line-diff.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
const ROW = {
|
|
6
|
+
added: "bg-success-soft text-success-soft-foreground",
|
|
7
|
+
context: "text-muted-foreground",
|
|
8
|
+
removed: "bg-destructive-soft text-destructive-soft-foreground",
|
|
9
|
+
};
|
|
10
|
+
const MARK = {
|
|
11
|
+
added: "+",
|
|
12
|
+
context: "",
|
|
13
|
+
removed: "−",
|
|
14
|
+
};
|
|
15
|
+
function FileDiff({ addedLabel = "Added", after, before, className, context = 3, removedLabel = "Removed", skippedLabel = (count) => `${count} unchanged lines`, ...props }) {
|
|
16
|
+
const diff = useMemo(() => lineDiff(before, after, context), [after, before, context]);
|
|
17
|
+
return (_jsx("div", { className: cn("overflow-hidden rounded-md border border-border bg-recessed font-mono text-xs leading-5", className), "data-slot": "file-diff", ...props, children: diff.lines.map((line, index) => line.kind === "skipped" ? (_jsx("div", { className: "px-2.5 py-0.5 text-muted-foreground select-none", children: `… ${skippedLabel(line.count)}` }, index)) : (_jsxs("div", { className: cn("grid grid-cols-[1.25rem_minmax(0,1fr)] pr-2.5", ROW[line.kind]), "data-kind": line.kind, children: [_jsx("span", { "aria-hidden": "true", className: "text-center select-none", children: MARK[line.kind] }), line.kind !== "context" ? (_jsx("span", { className: "sr-only", children: line.kind === "added" ? addedLabel : removedLabel })) : null, _jsx("span", { className: "break-words whitespace-pre-wrap", children: line.text || " " })] }, index))) }));
|
|
18
|
+
}
|
|
19
|
+
export { FileDiff };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/components/settings-section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/components/settings-section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAOL,KAAK,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CAAC,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,YAAY,EAAE,yBAAyB,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,qBAsCA;AAED,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
import {
|
|
3
|
+
import { FooterStrip } from "../internal/footer-strip.js";
|
|
4
|
+
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle, } from "./card.js";
|
|
4
5
|
import { Separator } from "./separator.js";
|
|
5
6
|
import { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, } from "./field.js";
|
|
6
7
|
function SettingsSection({ title, description, actions, footer, footerHint, children, className, surface = "resting", ...props }) {
|
|
7
|
-
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "settings-section" }), surface: surface, className: cn("min-w-0", className), children: [(title || description || actions) && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [title && (_jsx(CardTitle, { children: _jsx("h2", { children: title }) })), description && _jsx(CardDescription, { children: description }), actions && _jsx(CardAction, { children: actions })] }), _jsx(Separator, {})] })), _jsx(CardContent, { children: _jsx(FieldGroup, { "data-slot": "settings-section-fields", children: children }) }), (
|
|
8
|
+
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "settings-section" }), surface: surface, className: cn("min-w-0", className), children: [(title || description || actions) && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [title && (_jsx(CardTitle, { children: _jsx("h2", { children: title }) })), description && _jsx(CardDescription, { children: description }), actions && _jsx(CardAction, { children: actions })] }), _jsx(Separator, {})] })), _jsx(CardContent, { children: _jsx(FieldGroup, { "data-slot": "settings-section-fields", children: children }) }), _jsx(FooterStrip, { hint: footerHint, hintSlot: "settings-section-hint", children: footer })] }));
|
|
8
9
|
}
|
|
9
10
|
function SettingsField({ id, label, description, error, invalid = Boolean(error), disabled, required, children, className, contentClassName, controlClassName, ...props }) {
|
|
10
11
|
const descriptionId = description ? `${id}-description` : undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type CardSurface } from "./card.js";
|
|
3
|
+
/** The Portal's registry tables draw the same frame. */
|
|
4
|
+
declare function TableCard({ title, description, actions, footer, footerHint, children, className, surface, ...props }: Omit<React.ComponentProps<"section">, "title"> & {
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
actions?: React.ReactNode;
|
|
8
|
+
footer?: React.ReactNode;
|
|
9
|
+
footerHint?: React.ReactNode;
|
|
10
|
+
surface?: CardSurface;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
export { TableCard };
|
|
13
|
+
//# sourceMappingURL=table-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-card.d.ts","sourceRoot":"","sources":["../../src/components/table-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAA4D,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGpG,wDAAwD;AACxD,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,GAAG;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,qBA6BA;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { FooterStrip } from "../internal/footer-strip.js";
|
|
4
|
+
import { Card, CardAction, CardDescription, CardHeader, CardTitle } from "./card.js";
|
|
5
|
+
import { Separator } from "./separator.js";
|
|
6
|
+
/** The Portal's registry tables draw the same frame. */
|
|
7
|
+
function TableCard({ title, description, actions, footer, footerHint, children, className, surface = "resting", ...props }) {
|
|
8
|
+
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "table-card" }), surface: surface, className: cn("min-w-0 gap-0 py-0", className), children: [(title || description || actions) && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { className: "py-(--card-spacing)", children: [title && (_jsx(CardTitle, { children: _jsx("h2", { children: title }) })), description && _jsx(CardDescription, { children: description }), actions && _jsx(CardAction, { children: actions })] }), _jsx(Separator, {})] })), _jsx("div", { "data-slot": "table-card-body", className: "min-w-0", children: children }), _jsx(FooterStrip, { hint: footerHint, hintSlot: "table-card-hint", children: footer })] }));
|
|
9
|
+
}
|
|
10
|
+
export { TableCard };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export declare const tableCompactLayouts: {
|
|
2
|
+
readonly tight: {
|
|
3
|
+
readonly column: "hidden @xl/table:table-cell";
|
|
4
|
+
readonly row: "@max-xl/table:border-b-0";
|
|
5
|
+
readonly details: "@xl/table:hidden";
|
|
6
|
+
readonly table: "@max-xl/table:table-auto @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child)]:w-px @max-xl/table:[&_th]:px-2 @max-xl/table:[&_td]:px-2 @xl/table:[&_th]:px-4 @xl/table:[&_td]:px-4";
|
|
7
|
+
};
|
|
2
8
|
readonly standard: {
|
|
3
9
|
readonly column: "hidden @3xl/table:table-cell";
|
|
4
10
|
readonly row: "@max-3xl/table:border-b-0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-layouts.d.ts","sourceRoot":"","sources":["../../src/components/table-layouts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"table-layouts.d.ts","sourceRoot":"","sources":["../../src/components/table-layouts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;CA6BtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export const tableCompactLayouts = {
|
|
2
|
+
tight: {
|
|
3
|
+
column: "hidden @xl/table:table-cell",
|
|
4
|
+
row: "@max-xl/table:border-b-0",
|
|
5
|
+
details: "@xl/table:hidden",
|
|
6
|
+
table: "@max-xl/table:table-auto @max-xl/table:[&_td]:whitespace-normal @max-xl/table:[&_th:not(:first-child)]:w-px @max-xl/table:[&_th]:px-2 @max-xl/table:[&_td]:px-2 @xl/table:[&_th]:px-4 @xl/table:[&_td]:px-4",
|
|
7
|
+
},
|
|
2
8
|
standard: {
|
|
3
9
|
column: "hidden @3xl/table:table-cell",
|
|
4
10
|
row: "@max-3xl/table:border-b-0",
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export * from "./components/expandable-block.js";
|
|
|
53
53
|
export * from "./components/fact-cell.js";
|
|
54
54
|
export * from "./components/feedback-state.js";
|
|
55
55
|
export * from "./components/field.js";
|
|
56
|
+
export * from "./components/file-diff.js";
|
|
56
57
|
export * from "./components/file-type-icon.js";
|
|
57
58
|
export * from "./components/footer.js";
|
|
58
59
|
export * from "./components/form.js";
|
|
@@ -100,6 +101,7 @@ export * from "./components/status-dot.js";
|
|
|
100
101
|
export * from "./components/status-row.js";
|
|
101
102
|
export * from "./components/switch.js";
|
|
102
103
|
export * from "./components/table.js";
|
|
104
|
+
export * from "./components/table-card.js";
|
|
103
105
|
export * from "./components/table-value.js";
|
|
104
106
|
export * from "./components/object-workspace.js";
|
|
105
107
|
export * from "./components/tabs.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC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,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ export * from "./components/expandable-block.js";
|
|
|
53
53
|
export * from "./components/fact-cell.js";
|
|
54
54
|
export * from "./components/feedback-state.js";
|
|
55
55
|
export * from "./components/field.js";
|
|
56
|
+
export * from "./components/file-diff.js";
|
|
56
57
|
export * from "./components/file-type-icon.js";
|
|
57
58
|
export * from "./components/footer.js";
|
|
58
59
|
export * from "./components/form.js";
|
|
@@ -100,6 +101,7 @@ export * from "./components/status-dot.js";
|
|
|
100
101
|
export * from "./components/status-row.js";
|
|
101
102
|
export * from "./components/switch.js";
|
|
102
103
|
export * from "./components/table.js";
|
|
104
|
+
export * from "./components/table-card.js";
|
|
103
105
|
export * from "./components/table-value.js";
|
|
104
106
|
export * from "./components/object-workspace.js";
|
|
105
107
|
export * from "./components/tabs.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The strip a settings section and a table card close with (DESIGN.md "Settings cards"), drawn once so the two never
|
|
4
|
+
* drift apart.
|
|
5
|
+
*/
|
|
6
|
+
declare function FooterStrip({ hint, hintSlot, children, }: {
|
|
7
|
+
hint?: React.ReactNode;
|
|
8
|
+
hintSlot: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}): React.JSX.Element | null;
|
|
11
|
+
export { FooterStrip };
|
|
12
|
+
//# sourceMappingURL=footer-strip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer-strip.d.ts","sourceRoot":"","sources":["../../src/internal/footer-strip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;GAGG;AACH,iBAAS,WAAW,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,4BAeA;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CardFooter } from "../components/card.js";
|
|
3
|
+
/**
|
|
4
|
+
* The strip a settings section and a table card close with (DESIGN.md "Settings cards"), drawn once so the two never
|
|
5
|
+
* drift apart.
|
|
6
|
+
*/
|
|
7
|
+
function FooterStrip({ hint, hintSlot, children, }) {
|
|
8
|
+
if (!hint && !children) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsxs(CardFooter, { className: "mx-px mb-px flex-wrap gap-3 rounded-b-[calc(var(--radius-md)-1px)] border-t border-border bg-recessed py-3", children: [hint && (_jsx("div", { "data-slot": hintSlot, className: "min-w-0 flex-1 text-muted-foreground", children: hint })), children && _jsx("div", { className: "ml-auto flex flex-wrap items-center gap-3", children: children })] }));
|
|
12
|
+
}
|
|
13
|
+
export { FooterStrip };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A dropdown and a context menu carry the same commands over the same dense rows, so both take this solid floating
|
|
3
|
+
* surface; DESIGN.md ("Elevation & Depth") keeps glass for chrome that floats over colour or motion.
|
|
4
|
+
*/
|
|
5
|
+
export declare const menuSurface = "group/menu z-50 max-h-(--available-height) w-max min-w-[min(14rem,var(--available-width))] max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-md border-0 bg-popover p-nadicode-xxs text-popover-foreground nc-elevation-floating outline-none data-closed:overflow-hidden";
|
|
6
|
+
//# sourceMappingURL=menu-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-surface.d.ts","sourceRoot":"","sources":["../../src/internal/menu-surface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,gSACuQ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A dropdown and a context menu carry the same commands over the same dense rows, so both take this solid floating
|
|
3
|
+
* surface; DESIGN.md ("Elevation & Depth") keeps glass for chrome that floats over colour or motion.
|
|
4
|
+
*/
|
|
5
|
+
export const menuSurface = "group/menu z-50 max-h-(--available-height) w-max min-w-[min(14rem,var(--available-width))] max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-md border-0 bg-popover p-nadicode-xxs text-popover-foreground nc-elevation-floating outline-none data-closed:overflow-hidden";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type DiffLine = {
|
|
2
|
+
kind: "added" | "context" | "removed";
|
|
3
|
+
text: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: "skipped";
|
|
6
|
+
count: number;
|
|
7
|
+
};
|
|
8
|
+
export interface LineDiff {
|
|
9
|
+
added: number;
|
|
10
|
+
lines: DiffLine[];
|
|
11
|
+
removed: number;
|
|
12
|
+
}
|
|
13
|
+
/** Unchanged lines fold to `context` lines around each change. */
|
|
14
|
+
export declare function lineDiff(before: string, after: string, context?: number): LineDiff;
|
|
15
|
+
//# sourceMappingURL=line-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-diff.d.ts","sourceRoot":"","sources":["../../src/lib/line-diff.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAqID,kEAAkE;AAClE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,QAAQ,CAO7E"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each round keeps only its own diagonals, so the search holds at most about two million numbers whatever the texts'
|
|
3
|
+
* length; a change past it shows its changed stretch as every line removed, then every line added.
|
|
4
|
+
*/
|
|
5
|
+
const MAX_EDITS = 2000;
|
|
6
|
+
function linesOf(text) {
|
|
7
|
+
if (text === "")
|
|
8
|
+
return [];
|
|
9
|
+
const lines = text.split("\n");
|
|
10
|
+
if (lines[lines.length - 1] === "")
|
|
11
|
+
lines.pop();
|
|
12
|
+
return lines;
|
|
13
|
+
}
|
|
14
|
+
/** A round's diagonals `k` run from `-d` to `d` in steps of two. */
|
|
15
|
+
function reached(rounds, d, k) {
|
|
16
|
+
return rounds[d][(k + d) >> 1];
|
|
17
|
+
}
|
|
18
|
+
/** Myers's algorithm, or null when the script needs more than MAX_EDITS. */
|
|
19
|
+
function shortestScript(before, after) {
|
|
20
|
+
const n = before.length;
|
|
21
|
+
const m = after.length;
|
|
22
|
+
const rounds = [];
|
|
23
|
+
let found = false;
|
|
24
|
+
for (let d = 0; d <= Math.min(n + m, MAX_EDITS) && !found; d += 1) {
|
|
25
|
+
const round = new Int32Array(d + 1);
|
|
26
|
+
for (let k = -d; k <= d; k += 2) {
|
|
27
|
+
let x = d === 0
|
|
28
|
+
? 0
|
|
29
|
+
: k === -d || (k !== d && reached(rounds, d - 1, k - 1) < reached(rounds, d - 1, k + 1))
|
|
30
|
+
? reached(rounds, d - 1, k + 1)
|
|
31
|
+
: reached(rounds, d - 1, k - 1) + 1;
|
|
32
|
+
let y = x - k;
|
|
33
|
+
while (x < n && y < m && before[x] === after[y]) {
|
|
34
|
+
x += 1;
|
|
35
|
+
y += 1;
|
|
36
|
+
}
|
|
37
|
+
round[(k + d) >> 1] = x;
|
|
38
|
+
if (x >= n && y >= m) {
|
|
39
|
+
found = true;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
rounds.push(round);
|
|
44
|
+
}
|
|
45
|
+
if (!found)
|
|
46
|
+
return null;
|
|
47
|
+
const edits = [];
|
|
48
|
+
let x = n;
|
|
49
|
+
let y = m;
|
|
50
|
+
for (let d = rounds.length - 1; d > 0; d -= 1) {
|
|
51
|
+
const k = x - y;
|
|
52
|
+
const previousK = k === -d || (k !== d && reached(rounds, d - 1, k - 1) < reached(rounds, d - 1, k + 1))
|
|
53
|
+
? k + 1
|
|
54
|
+
: k - 1;
|
|
55
|
+
const previousX = reached(rounds, d - 1, previousK);
|
|
56
|
+
const previousY = previousX - previousK;
|
|
57
|
+
while (x > previousX && y > previousY) {
|
|
58
|
+
x -= 1;
|
|
59
|
+
y -= 1;
|
|
60
|
+
edits.push({ kind: "context", text: before[x] });
|
|
61
|
+
}
|
|
62
|
+
if (x === previousX) {
|
|
63
|
+
y -= 1;
|
|
64
|
+
edits.push({ kind: "added", text: after[y] });
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
x -= 1;
|
|
68
|
+
edits.push({ kind: "removed", text: before[x] });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
while (x > 0 && y > 0) {
|
|
72
|
+
x -= 1;
|
|
73
|
+
y -= 1;
|
|
74
|
+
edits.push({ kind: "context", text: before[x] });
|
|
75
|
+
}
|
|
76
|
+
return edits.reverse();
|
|
77
|
+
}
|
|
78
|
+
function editScript(before, after) {
|
|
79
|
+
let start = 0;
|
|
80
|
+
while (start < before.length && start < after.length && before[start] === after[start])
|
|
81
|
+
start += 1;
|
|
82
|
+
let endBefore = before.length;
|
|
83
|
+
let endAfter = after.length;
|
|
84
|
+
while (endBefore > start && endAfter > start && before[endBefore - 1] === after[endAfter - 1]) {
|
|
85
|
+
endBefore -= 1;
|
|
86
|
+
endAfter -= 1;
|
|
87
|
+
}
|
|
88
|
+
const changedBefore = before.slice(start, endBefore);
|
|
89
|
+
const changedAfter = after.slice(start, endAfter);
|
|
90
|
+
const changed = shortestScript(changedBefore, changedAfter) ?? [
|
|
91
|
+
...changedBefore.map((text) => ({ kind: "removed", text })),
|
|
92
|
+
...changedAfter.map((text) => ({ kind: "added", text })),
|
|
93
|
+
];
|
|
94
|
+
return [
|
|
95
|
+
...before.slice(0, start).map((text) => ({ kind: "context", text })),
|
|
96
|
+
...changed,
|
|
97
|
+
...before.slice(endBefore).map((text) => ({ kind: "context", text })),
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
function fold(edits, context) {
|
|
101
|
+
const out = [];
|
|
102
|
+
let run = [];
|
|
103
|
+
const flush = (leading, trailing) => {
|
|
104
|
+
if (run.length <= leading + trailing) {
|
|
105
|
+
out.push(...run);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
out.push(...run.slice(0, leading));
|
|
109
|
+
out.push({ kind: "skipped", count: run.length - leading - trailing });
|
|
110
|
+
out.push(...run.slice(run.length - trailing));
|
|
111
|
+
}
|
|
112
|
+
run = [];
|
|
113
|
+
};
|
|
114
|
+
let seenChange = false;
|
|
115
|
+
for (const edit of edits) {
|
|
116
|
+
if (edit.kind === "context") {
|
|
117
|
+
run.push(edit);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
flush(seenChange ? context : 0, context);
|
|
121
|
+
out.push(edit);
|
|
122
|
+
seenChange = true;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
flush(seenChange ? context : 0, 0);
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
/** Unchanged lines fold to `context` lines around each change. */
|
|
129
|
+
export function lineDiff(before, after, context = 3) {
|
|
130
|
+
const edits = editScript(linesOf(before), linesOf(after));
|
|
131
|
+
return {
|
|
132
|
+
added: edits.filter((edit) => edit.kind === "added").length,
|
|
133
|
+
lines: fold(edits, context),
|
|
134
|
+
removed: edits.filter((edit) => edit.kind === "removed").length,
|
|
135
|
+
};
|
|
136
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@assistant-ui/react": "0.15.21",
|
|
72
72
|
"@assistant-ui/react-markdown": "0.14.16",
|
|
73
73
|
"@base-ui/react": "^1.8.0",
|
|
74
|
-
"@nadicodeai/design-system": "12.1.
|
|
74
|
+
"@nadicodeai/design-system": "12.1.20",
|
|
75
75
|
"class-variance-authority": "^0.7.1",
|
|
76
76
|
"clsx": "^2.1.1",
|
|
77
77
|
"cmdk": "^1.1.1",
|