@lukeashford/aurelius 4.10.2 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +94 -8
- package/dist/index.d.ts +94 -8
- package/dist/index.js +759 -694
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +580 -516
- package/dist/index.mjs.map +1 -1
- package/llms.md +21 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ __export(index_exports, {
|
|
|
53
53
|
Breadcrumb: () => Breadcrumb,
|
|
54
54
|
BreadcrumbItem: () => BreadcrumbItem,
|
|
55
55
|
BreadcrumbLink: () => BreadcrumbLink,
|
|
56
|
+
BusyOverlay: () => BusyOverlay,
|
|
56
57
|
Button: () => Button,
|
|
57
58
|
Card: () => Card,
|
|
58
59
|
ChatBubbleIcon: () => ChatBubbleIcon,
|
|
@@ -2620,8 +2621,45 @@ var Progress = import_react31.default.forwardRef(
|
|
|
2620
2621
|
);
|
|
2621
2622
|
Progress.displayName = "Progress";
|
|
2622
2623
|
|
|
2623
|
-
// src/components/
|
|
2624
|
+
// src/components/BusyOverlay.tsx
|
|
2624
2625
|
var import_react32 = __toESM(require("react"));
|
|
2626
|
+
var blurClass = {
|
|
2627
|
+
sm: "backdrop-blur-sm",
|
|
2628
|
+
md: "backdrop-blur-md",
|
|
2629
|
+
lg: "backdrop-blur-lg"
|
|
2630
|
+
};
|
|
2631
|
+
var toneClass = {
|
|
2632
|
+
dim: "bg-obsidian/40",
|
|
2633
|
+
frost: "bg-obsidian/80"
|
|
2634
|
+
};
|
|
2635
|
+
function BusyOverlay({
|
|
2636
|
+
label,
|
|
2637
|
+
blurStrength = "sm",
|
|
2638
|
+
tone = "dim",
|
|
2639
|
+
className,
|
|
2640
|
+
...rest
|
|
2641
|
+
}) {
|
|
2642
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
2643
|
+
"div",
|
|
2644
|
+
{
|
|
2645
|
+
role: "status",
|
|
2646
|
+
"aria-live": "polite",
|
|
2647
|
+
"aria-busy": "true",
|
|
2648
|
+
className: cx(
|
|
2649
|
+
"absolute inset-0 z-10 flex items-center justify-center",
|
|
2650
|
+
toneClass[tone],
|
|
2651
|
+
blurClass[blurStrength],
|
|
2652
|
+
className
|
|
2653
|
+
),
|
|
2654
|
+
...rest
|
|
2655
|
+
},
|
|
2656
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { className: "flex items-center gap-2 text-white text-sm font-medium" }, /* @__PURE__ */ import_react32.default.createElement(Spinner, { size: "sm" }), label && /* @__PURE__ */ import_react32.default.createElement("span", null, label))
|
|
2657
|
+
);
|
|
2658
|
+
}
|
|
2659
|
+
BusyOverlay.displayName = "BusyOverlay";
|
|
2660
|
+
|
|
2661
|
+
// src/components/Toast.tsx
|
|
2662
|
+
var import_react33 = __toESM(require("react"));
|
|
2625
2663
|
var import_react_dom = require("react-dom");
|
|
2626
2664
|
var import_lucide_react5 = require("lucide-react");
|
|
2627
2665
|
var toastCounter = 0;
|
|
@@ -2629,13 +2667,13 @@ function createToastId() {
|
|
|
2629
2667
|
toastCounter += 1;
|
|
2630
2668
|
return `toast-${Date.now().toString(36)}-${toastCounter}`;
|
|
2631
2669
|
}
|
|
2632
|
-
var ToastContext = (0,
|
|
2670
|
+
var ToastContext = (0, import_react33.createContext)(null);
|
|
2633
2671
|
function useToast() {
|
|
2634
|
-
const context = (0,
|
|
2672
|
+
const context = (0, import_react33.useContext)(ToastContext);
|
|
2635
2673
|
if (!context) {
|
|
2636
2674
|
throw new Error("useToast must be used within a ToastProvider");
|
|
2637
2675
|
}
|
|
2638
|
-
const toast = (0,
|
|
2676
|
+
const toast = (0, import_react33.useCallback)(
|
|
2639
2677
|
(options) => {
|
|
2640
2678
|
return context.addToast(options);
|
|
2641
2679
|
},
|
|
@@ -2651,12 +2689,12 @@ var ToastProvider = ({
|
|
|
2651
2689
|
position = "bottom-right",
|
|
2652
2690
|
defaultDuration = 5e3
|
|
2653
2691
|
}) => {
|
|
2654
|
-
const [toasts, setToasts] = (0,
|
|
2655
|
-
const [mounted, setMounted] = (0,
|
|
2656
|
-
(0,
|
|
2692
|
+
const [toasts, setToasts] = (0, import_react33.useState)([]);
|
|
2693
|
+
const [mounted, setMounted] = (0, import_react33.useState)(false);
|
|
2694
|
+
(0, import_react33.useEffect)(() => {
|
|
2657
2695
|
setMounted(true);
|
|
2658
2696
|
}, []);
|
|
2659
|
-
const addToast = (0,
|
|
2697
|
+
const addToast = (0, import_react33.useCallback)(
|
|
2660
2698
|
(toast) => {
|
|
2661
2699
|
const id = createToastId();
|
|
2662
2700
|
const newToast = {
|
|
@@ -2669,10 +2707,10 @@ var ToastProvider = ({
|
|
|
2669
2707
|
},
|
|
2670
2708
|
[defaultDuration]
|
|
2671
2709
|
);
|
|
2672
|
-
const removeToast = (0,
|
|
2710
|
+
const removeToast = (0, import_react33.useCallback)((id) => {
|
|
2673
2711
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
2674
2712
|
}, []);
|
|
2675
|
-
return /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ import_react33.default.createElement(ToastContext.Provider, { value: { toasts, addToast, removeToast, position } }, children, mounted && /* @__PURE__ */ import_react33.default.createElement(ToastViewport, null));
|
|
2676
2714
|
};
|
|
2677
2715
|
ToastProvider.displayName = "ToastProvider";
|
|
2678
2716
|
var POSITION_CLASSES = {
|
|
@@ -2684,13 +2722,13 @@ var POSITION_CLASSES = {
|
|
|
2684
2722
|
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2"
|
|
2685
2723
|
};
|
|
2686
2724
|
var ToastViewport = () => {
|
|
2687
|
-
const context = (0,
|
|
2725
|
+
const context = (0, import_react33.useContext)(ToastContext);
|
|
2688
2726
|
if (!context) {
|
|
2689
2727
|
return null;
|
|
2690
2728
|
}
|
|
2691
2729
|
const { toasts, position } = context;
|
|
2692
2730
|
return (0, import_react_dom.createPortal)(
|
|
2693
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
2694
2732
|
"div",
|
|
2695
2733
|
{
|
|
2696
2734
|
className: cx(
|
|
@@ -2698,7 +2736,7 @@ var ToastViewport = () => {
|
|
|
2698
2736
|
POSITION_CLASSES[position]
|
|
2699
2737
|
)
|
|
2700
2738
|
},
|
|
2701
|
-
toasts.map((toast) => /* @__PURE__ */
|
|
2739
|
+
toasts.map((toast) => /* @__PURE__ */ import_react33.default.createElement(Toast, { key: toast.id, ...toast }))
|
|
2702
2740
|
),
|
|
2703
2741
|
document.body
|
|
2704
2742
|
);
|
|
@@ -2712,10 +2750,10 @@ var VARIANT_STYLES2 = {
|
|
|
2712
2750
|
};
|
|
2713
2751
|
var VARIANT_ICONS = {
|
|
2714
2752
|
default: null,
|
|
2715
|
-
success: /* @__PURE__ */
|
|
2716
|
-
error: /* @__PURE__ */
|
|
2717
|
-
warning: /* @__PURE__ */
|
|
2718
|
-
info: /* @__PURE__ */
|
|
2753
|
+
success: /* @__PURE__ */ import_react33.default.createElement(import_lucide_react5.CheckCircle, { className: "h-5 w-5 text-success" }),
|
|
2754
|
+
error: /* @__PURE__ */ import_react33.default.createElement(import_lucide_react5.AlertCircle, { className: "h-5 w-5 text-error" }),
|
|
2755
|
+
warning: /* @__PURE__ */ import_react33.default.createElement(import_lucide_react5.AlertTriangle, { className: "h-5 w-5 text-warning" }),
|
|
2756
|
+
info: /* @__PURE__ */ import_react33.default.createElement(import_lucide_react5.Info, { className: "h-5 w-5 text-info" })
|
|
2719
2757
|
};
|
|
2720
2758
|
var Toast = ({
|
|
2721
2759
|
id,
|
|
@@ -2725,8 +2763,8 @@ var Toast = ({
|
|
|
2725
2763
|
duration,
|
|
2726
2764
|
action
|
|
2727
2765
|
}) => {
|
|
2728
|
-
const context = (0,
|
|
2729
|
-
(0,
|
|
2766
|
+
const context = (0, import_react33.useContext)(ToastContext);
|
|
2767
|
+
(0, import_react33.useEffect)(() => {
|
|
2730
2768
|
if (duration && duration > 0) {
|
|
2731
2769
|
const timer = setTimeout(() => {
|
|
2732
2770
|
context?.removeToast(id);
|
|
@@ -2735,7 +2773,7 @@ var Toast = ({
|
|
|
2735
2773
|
}
|
|
2736
2774
|
}, [id, duration, context]);
|
|
2737
2775
|
const icon = VARIANT_ICONS[variant];
|
|
2738
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
2739
2777
|
"div",
|
|
2740
2778
|
{
|
|
2741
2779
|
role: "alert",
|
|
@@ -2744,26 +2782,26 @@ var Toast = ({
|
|
|
2744
2782
|
VARIANT_STYLES2[variant]
|
|
2745
2783
|
)
|
|
2746
2784
|
},
|
|
2747
|
-
/* @__PURE__ */
|
|
2785
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex gap-3" }, icon && /* @__PURE__ */ import_react33.default.createElement("div", { className: "shrink-0 mt-0.5" }, icon), /* @__PURE__ */ import_react33.default.createElement("div", { className: "flex-1 min-w-0" }, title && /* @__PURE__ */ import_react33.default.createElement("p", { className: "text-sm font-medium text-white" }, title), description && /* @__PURE__ */ import_react33.default.createElement("p", { className: "text-sm text-silver mt-1" }, description), action && /* @__PURE__ */ import_react33.default.createElement("div", { className: "mt-3" }, action)), /* @__PURE__ */ import_react33.default.createElement(
|
|
2748
2786
|
"button",
|
|
2749
2787
|
{
|
|
2750
2788
|
onClick: () => context?.removeToast(id),
|
|
2751
2789
|
className: "shrink-0 text-silver hover:text-white transition-colors"
|
|
2752
2790
|
},
|
|
2753
|
-
/* @__PURE__ */
|
|
2754
|
-
/* @__PURE__ */
|
|
2791
|
+
/* @__PURE__ */ import_react33.default.createElement(import_lucide_react5.X, { className: "h-4 w-4" }),
|
|
2792
|
+
/* @__PURE__ */ import_react33.default.createElement("span", { className: "sr-only" }, "Dismiss")
|
|
2755
2793
|
))
|
|
2756
2794
|
);
|
|
2757
2795
|
};
|
|
2758
2796
|
Toast.displayName = "Toast";
|
|
2759
2797
|
|
|
2760
2798
|
// src/components/Modal.tsx
|
|
2761
|
-
var
|
|
2799
|
+
var import_react34 = __toESM(require("react"));
|
|
2762
2800
|
var import_react_dom2 = require("react-dom");
|
|
2763
2801
|
var import_lucide_react6 = require("lucide-react");
|
|
2764
2802
|
var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
2765
|
-
const [mounted, setMounted] = (0,
|
|
2766
|
-
(0,
|
|
2803
|
+
const [mounted, setMounted] = (0, import_react34.useState)(false);
|
|
2804
|
+
(0, import_react34.useEffect)(() => {
|
|
2767
2805
|
setMounted(true);
|
|
2768
2806
|
}, []);
|
|
2769
2807
|
useScrollLock(isOpen);
|
|
@@ -2771,14 +2809,14 @@ var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
|
2771
2809
|
if (!mounted || !isOpen) {
|
|
2772
2810
|
return null;
|
|
2773
2811
|
}
|
|
2774
|
-
const content = /* @__PURE__ */
|
|
2812
|
+
const content = /* @__PURE__ */ import_react34.default.createElement(
|
|
2775
2813
|
"div",
|
|
2776
2814
|
{
|
|
2777
2815
|
className: "fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",
|
|
2778
2816
|
onClick: onClose
|
|
2779
2817
|
},
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ import_react34.default.createElement("div", { className: "fixed inset-0 z-40 bg-obsidian/80 backdrop-blur-sm", "aria-hidden": "true" }),
|
|
2819
|
+
/* @__PURE__ */ import_react34.default.createElement(
|
|
2782
2820
|
"div",
|
|
2783
2821
|
{
|
|
2784
2822
|
role: "dialog",
|
|
@@ -2790,16 +2828,16 @@ var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
|
2790
2828
|
"data-state": "open",
|
|
2791
2829
|
onClick: (e) => e.stopPropagation()
|
|
2792
2830
|
},
|
|
2793
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ import_react34.default.createElement("div", { className: "flex items-center justify-between mb-2" }, title ? /* @__PURE__ */ import_react34.default.createElement("h3", { className: "text-xl font-semibold text-white m-0" }, title) : /* @__PURE__ */ import_react34.default.createElement("div", null), /* @__PURE__ */ import_react34.default.createElement(
|
|
2794
2832
|
"button",
|
|
2795
2833
|
{
|
|
2796
2834
|
onClick: onClose,
|
|
2797
2835
|
className: "text-silver hover:text-white transition-colors ml-auto"
|
|
2798
2836
|
},
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ import_react34.default.createElement(import_lucide_react6.X, { className: "h-5 w-5" }),
|
|
2838
|
+
/* @__PURE__ */ import_react34.default.createElement("span", { className: "sr-only" }, "Close")
|
|
2801
2839
|
)),
|
|
2802
|
-
/* @__PURE__ */
|
|
2840
|
+
/* @__PURE__ */ import_react34.default.createElement("div", { className: "overflow-y-auto min-h-0" }, children)
|
|
2803
2841
|
)
|
|
2804
2842
|
);
|
|
2805
2843
|
return (0, import_react_dom2.createPortal)(content, document.body);
|
|
@@ -2807,12 +2845,12 @@ var Modal = ({ isOpen, onClose, title, children, className }) => {
|
|
|
2807
2845
|
Modal.displayName = "Modal";
|
|
2808
2846
|
|
|
2809
2847
|
// src/components/Lightbox.tsx
|
|
2810
|
-
var
|
|
2848
|
+
var import_react48 = __toESM(require("react"));
|
|
2811
2849
|
|
|
2812
2850
|
// src/components/icons/ChatBubbleIcon.tsx
|
|
2813
|
-
var
|
|
2851
|
+
var import_react35 = __toESM(require("react"));
|
|
2814
2852
|
function ChatBubbleIcon({ className, ...props }) {
|
|
2815
|
-
return /* @__PURE__ */
|
|
2853
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
2816
2854
|
"svg",
|
|
2817
2855
|
{
|
|
2818
2856
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2821,7 +2859,7 @@ function ChatBubbleIcon({ className, ...props }) {
|
|
|
2821
2859
|
className,
|
|
2822
2860
|
...props
|
|
2823
2861
|
},
|
|
2824
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ import_react35.default.createElement(
|
|
2825
2863
|
"path",
|
|
2826
2864
|
{
|
|
2827
2865
|
d: "M2 3h16v11H6l-4 3V3z"
|
|
@@ -2831,9 +2869,9 @@ function ChatBubbleIcon({ className, ...props }) {
|
|
|
2831
2869
|
}
|
|
2832
2870
|
|
|
2833
2871
|
// src/components/icons/ChevronLeftIcon.tsx
|
|
2834
|
-
var
|
|
2872
|
+
var import_react36 = __toESM(require("react"));
|
|
2835
2873
|
function ChevronLeftIcon({ className, ...props }) {
|
|
2836
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
2837
2875
|
"svg",
|
|
2838
2876
|
{
|
|
2839
2877
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2842,7 +2880,7 @@ function ChevronLeftIcon({ className, ...props }) {
|
|
|
2842
2880
|
className,
|
|
2843
2881
|
...props
|
|
2844
2882
|
},
|
|
2845
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
2846
2884
|
"path",
|
|
2847
2885
|
{
|
|
2848
2886
|
fillRule: "evenodd",
|
|
@@ -2854,9 +2892,9 @@ function ChevronLeftIcon({ className, ...props }) {
|
|
|
2854
2892
|
}
|
|
2855
2893
|
|
|
2856
2894
|
// src/components/icons/ChevronRightIcon.tsx
|
|
2857
|
-
var
|
|
2895
|
+
var import_react37 = __toESM(require("react"));
|
|
2858
2896
|
function ChevronRightIcon({ className, ...props }) {
|
|
2859
|
-
return /* @__PURE__ */
|
|
2897
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
|
2860
2898
|
"svg",
|
|
2861
2899
|
{
|
|
2862
2900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2865,7 +2903,7 @@ function ChevronRightIcon({ className, ...props }) {
|
|
|
2865
2903
|
className,
|
|
2866
2904
|
...props
|
|
2867
2905
|
},
|
|
2868
|
-
/* @__PURE__ */
|
|
2906
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
|
2869
2907
|
"path",
|
|
2870
2908
|
{
|
|
2871
2909
|
fillRule: "evenodd",
|
|
@@ -2877,9 +2915,9 @@ function ChevronRightIcon({ className, ...props }) {
|
|
|
2877
2915
|
}
|
|
2878
2916
|
|
|
2879
2917
|
// src/components/icons/CloseIcon.tsx
|
|
2880
|
-
var
|
|
2918
|
+
var import_react38 = __toESM(require("react"));
|
|
2881
2919
|
function CloseIcon({ className, ...props }) {
|
|
2882
|
-
return /* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ import_react38.default.createElement(
|
|
2883
2921
|
"svg",
|
|
2884
2922
|
{
|
|
2885
2923
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2888,7 +2926,7 @@ function CloseIcon({ className, ...props }) {
|
|
|
2888
2926
|
className,
|
|
2889
2927
|
...props
|
|
2890
2928
|
},
|
|
2891
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ import_react38.default.createElement(
|
|
2892
2930
|
"path",
|
|
2893
2931
|
{
|
|
2894
2932
|
d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
|
@@ -2898,9 +2936,9 @@ function CloseIcon({ className, ...props }) {
|
|
|
2898
2936
|
}
|
|
2899
2937
|
|
|
2900
2938
|
// src/components/icons/ExpandIcon.tsx
|
|
2901
|
-
var
|
|
2939
|
+
var import_react39 = __toESM(require("react"));
|
|
2902
2940
|
function ExpandIcon({ className, ...props }) {
|
|
2903
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
2904
2942
|
"svg",
|
|
2905
2943
|
{
|
|
2906
2944
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2909,7 +2947,7 @@ function ExpandIcon({ className, ...props }) {
|
|
|
2909
2947
|
className,
|
|
2910
2948
|
...props
|
|
2911
2949
|
},
|
|
2912
|
-
/* @__PURE__ */
|
|
2950
|
+
/* @__PURE__ */ import_react39.default.createElement(
|
|
2913
2951
|
"path",
|
|
2914
2952
|
{
|
|
2915
2953
|
d: "M13.28 7.78l3.22-3.22v2.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25v-4.5a.75.75 0 011.5 0v2.69l3.22-3.22a.75.75 0 011.06 1.06L4.56 16.5h2.69a.75.75 0 010 1.5h-4.5a.75.75 0 01-.75-.75z"
|
|
@@ -2919,9 +2957,9 @@ function ExpandIcon({ className, ...props }) {
|
|
|
2919
2957
|
}
|
|
2920
2958
|
|
|
2921
2959
|
// src/components/icons/HistoryIcon.tsx
|
|
2922
|
-
var
|
|
2960
|
+
var import_react40 = __toESM(require("react"));
|
|
2923
2961
|
function HistoryIcon({ className, ...props }) {
|
|
2924
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
|
2925
2963
|
"svg",
|
|
2926
2964
|
{
|
|
2927
2965
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2930,7 +2968,7 @@ function HistoryIcon({ className, ...props }) {
|
|
|
2930
2968
|
className,
|
|
2931
2969
|
...props
|
|
2932
2970
|
},
|
|
2933
|
-
/* @__PURE__ */
|
|
2971
|
+
/* @__PURE__ */ import_react40.default.createElement(
|
|
2934
2972
|
"path",
|
|
2935
2973
|
{
|
|
2936
2974
|
fillRule: "evenodd",
|
|
@@ -2942,9 +2980,9 @@ function HistoryIcon({ className, ...props }) {
|
|
|
2942
2980
|
}
|
|
2943
2981
|
|
|
2944
2982
|
// src/components/icons/LayersIcon.tsx
|
|
2945
|
-
var
|
|
2983
|
+
var import_react41 = __toESM(require("react"));
|
|
2946
2984
|
function LayersIcon({ className, ...props }) {
|
|
2947
|
-
return /* @__PURE__ */
|
|
2985
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
|
2948
2986
|
"svg",
|
|
2949
2987
|
{
|
|
2950
2988
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2953,19 +2991,19 @@ function LayersIcon({ className, ...props }) {
|
|
|
2953
2991
|
className,
|
|
2954
2992
|
...props
|
|
2955
2993
|
},
|
|
2956
|
-
/* @__PURE__ */
|
|
2994
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
2957
2995
|
"path",
|
|
2958
2996
|
{
|
|
2959
2997
|
d: "M3.196 12.87l-.825.483a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.758 0l7.25-4.25a.75.75 0 000-1.294l-.825-.484-5.666 3.322a2.25 2.25 0 01-2.276 0L3.196 12.87z"
|
|
2960
2998
|
}
|
|
2961
2999
|
),
|
|
2962
|
-
/* @__PURE__ */
|
|
3000
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
2963
3001
|
"path",
|
|
2964
3002
|
{
|
|
2965
3003
|
d: "M3.196 8.87l-.825.483a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.758 0l7.25-4.25a.75.75 0 000-1.294l-.825-.484-5.666 3.322a2.25 2.25 0 01-2.276 0L3.196 8.87z"
|
|
2966
3004
|
}
|
|
2967
3005
|
),
|
|
2968
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ import_react41.default.createElement(
|
|
2969
3007
|
"path",
|
|
2970
3008
|
{
|
|
2971
3009
|
d: "M10.38 1.103a.75.75 0 00-.76 0l-7.25 4.25a.75.75 0 000 1.294l7.25 4.25a.75.75 0 00.76 0l7.25-4.25a.75.75 0 000-1.294l-7.25-4.25z"
|
|
@@ -2975,9 +3013,9 @@ function LayersIcon({ className, ...props }) {
|
|
|
2975
3013
|
}
|
|
2976
3014
|
|
|
2977
3015
|
// src/components/icons/MediaIcon.tsx
|
|
2978
|
-
var
|
|
3016
|
+
var import_react42 = __toESM(require("react"));
|
|
2979
3017
|
function MediaIcon({ className, ...props }) {
|
|
2980
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ import_react42.default.createElement(
|
|
2981
3019
|
"svg",
|
|
2982
3020
|
{
|
|
2983
3021
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2986,7 +3024,7 @@ function MediaIcon({ className, ...props }) {
|
|
|
2986
3024
|
className,
|
|
2987
3025
|
...props
|
|
2988
3026
|
},
|
|
2989
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ import_react42.default.createElement(
|
|
2990
3028
|
"path",
|
|
2991
3029
|
{
|
|
2992
3030
|
fillRule: "evenodd",
|
|
@@ -2998,9 +3036,9 @@ function MediaIcon({ className, ...props }) {
|
|
|
2998
3036
|
}
|
|
2999
3037
|
|
|
3000
3038
|
// src/components/icons/PlusIcon.tsx
|
|
3001
|
-
var
|
|
3039
|
+
var import_react43 = __toESM(require("react"));
|
|
3002
3040
|
function PlusIcon({ className, ...props }) {
|
|
3003
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ import_react43.default.createElement(
|
|
3004
3042
|
"svg",
|
|
3005
3043
|
{
|
|
3006
3044
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3009,7 +3047,7 @@ function PlusIcon({ className, ...props }) {
|
|
|
3009
3047
|
className,
|
|
3010
3048
|
...props
|
|
3011
3049
|
},
|
|
3012
|
-
/* @__PURE__ */
|
|
3050
|
+
/* @__PURE__ */ import_react43.default.createElement(
|
|
3013
3051
|
"path",
|
|
3014
3052
|
{
|
|
3015
3053
|
d: "M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"
|
|
@@ -3019,9 +3057,9 @@ function PlusIcon({ className, ...props }) {
|
|
|
3019
3057
|
}
|
|
3020
3058
|
|
|
3021
3059
|
// src/components/icons/CheckSquareIcon.tsx
|
|
3022
|
-
var
|
|
3060
|
+
var import_react44 = __toESM(require("react"));
|
|
3023
3061
|
function CheckSquareIcon({ className, ...props }) {
|
|
3024
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
3025
3063
|
"div",
|
|
3026
3064
|
{
|
|
3027
3065
|
className: cx(
|
|
@@ -3030,14 +3068,14 @@ function CheckSquareIcon({ className, ...props }) {
|
|
|
3030
3068
|
),
|
|
3031
3069
|
...props
|
|
3032
3070
|
},
|
|
3033
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
|
3034
3072
|
"svg",
|
|
3035
3073
|
{
|
|
3036
3074
|
viewBox: "0 0 16 16",
|
|
3037
3075
|
fill: "none",
|
|
3038
3076
|
className: "absolute inset-0 w-full h-full p-0.5"
|
|
3039
3077
|
},
|
|
3040
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ import_react44.default.createElement(
|
|
3041
3079
|
"path",
|
|
3042
3080
|
{
|
|
3043
3081
|
d: "M3 8l3 3 7-7",
|
|
@@ -3053,9 +3091,9 @@ function CheckSquareIcon({ className, ...props }) {
|
|
|
3053
3091
|
}
|
|
3054
3092
|
|
|
3055
3093
|
// src/components/icons/EmptySquareIcon.tsx
|
|
3056
|
-
var
|
|
3094
|
+
var import_react45 = __toESM(require("react"));
|
|
3057
3095
|
function EmptySquareIcon({ className, ...props }) {
|
|
3058
|
-
return /* @__PURE__ */
|
|
3096
|
+
return /* @__PURE__ */ import_react45.default.createElement(
|
|
3059
3097
|
"div",
|
|
3060
3098
|
{
|
|
3061
3099
|
className: cx(
|
|
@@ -3068,9 +3106,9 @@ function EmptySquareIcon({ className, ...props }) {
|
|
|
3068
3106
|
}
|
|
3069
3107
|
|
|
3070
3108
|
// src/components/icons/CrossSquareIcon.tsx
|
|
3071
|
-
var
|
|
3109
|
+
var import_react46 = __toESM(require("react"));
|
|
3072
3110
|
function CrossSquareIcon({ className, variant = "cancelled", ...props }) {
|
|
3073
|
-
return /* @__PURE__ */
|
|
3111
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
3074
3112
|
"div",
|
|
3075
3113
|
{
|
|
3076
3114
|
className: cx(
|
|
@@ -3080,14 +3118,14 @@ function CrossSquareIcon({ className, variant = "cancelled", ...props }) {
|
|
|
3080
3118
|
),
|
|
3081
3119
|
...props
|
|
3082
3120
|
},
|
|
3083
|
-
/* @__PURE__ */
|
|
3121
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3084
3122
|
"svg",
|
|
3085
3123
|
{
|
|
3086
3124
|
viewBox: "0 0 16 16",
|
|
3087
3125
|
fill: "none",
|
|
3088
3126
|
className: "absolute inset-0 w-full h-full p-0.5"
|
|
3089
3127
|
},
|
|
3090
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
3091
3129
|
"path",
|
|
3092
3130
|
{
|
|
3093
3131
|
d: "M4 4l8 8M12 4l-8 8",
|
|
@@ -3102,15 +3140,15 @@ function CrossSquareIcon({ className, variant = "cancelled", ...props }) {
|
|
|
3102
3140
|
}
|
|
3103
3141
|
|
|
3104
3142
|
// src/components/icons/SquareLoaderIcon.tsx
|
|
3105
|
-
var
|
|
3143
|
+
var import_react47 = __toESM(require("react"));
|
|
3106
3144
|
function SquareLoaderIcon({ className, ...props }) {
|
|
3107
|
-
return /* @__PURE__ */
|
|
3145
|
+
return /* @__PURE__ */ import_react47.default.createElement("div", { className: cx("relative w-4 h-4 flex-shrink-0", className), ...props }, /* @__PURE__ */ import_react47.default.createElement(
|
|
3108
3146
|
"svg",
|
|
3109
3147
|
{
|
|
3110
3148
|
viewBox: "0 0 16 16",
|
|
3111
3149
|
className: "w-full h-full animate-snake-spin"
|
|
3112
3150
|
},
|
|
3113
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3114
3152
|
"rect",
|
|
3115
3153
|
{
|
|
3116
3154
|
x: "1",
|
|
@@ -3123,7 +3161,7 @@ function SquareLoaderIcon({ className, ...props }) {
|
|
|
3123
3161
|
className: "text-ash/40"
|
|
3124
3162
|
}
|
|
3125
3163
|
),
|
|
3126
|
-
/* @__PURE__ */
|
|
3164
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3127
3165
|
"rect",
|
|
3128
3166
|
{
|
|
3129
3167
|
x: "1",
|
|
@@ -3150,12 +3188,12 @@ function Lightbox({
|
|
|
3150
3188
|
className
|
|
3151
3189
|
}) {
|
|
3152
3190
|
useEscapeKey(onClose);
|
|
3153
|
-
const handleSurfaceClick = (0,
|
|
3191
|
+
const handleSurfaceClick = (0, import_react48.useCallback)((e) => {
|
|
3154
3192
|
if (e.target === e.currentTarget) {
|
|
3155
3193
|
onClose();
|
|
3156
3194
|
}
|
|
3157
3195
|
}, [onClose]);
|
|
3158
|
-
return /* @__PURE__ */
|
|
3196
|
+
return /* @__PURE__ */ import_react48.default.createElement(
|
|
3159
3197
|
"div",
|
|
3160
3198
|
{
|
|
3161
3199
|
className: cx(
|
|
@@ -3167,7 +3205,7 @@ function Lightbox({
|
|
|
3167
3205
|
role: "dialog",
|
|
3168
3206
|
"aria-modal": "true"
|
|
3169
3207
|
},
|
|
3170
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ import_react48.default.createElement(
|
|
3171
3209
|
"div",
|
|
3172
3210
|
{
|
|
3173
3211
|
className: cx(
|
|
@@ -3176,18 +3214,18 @@ function Lightbox({
|
|
|
3176
3214
|
"group/actions hover:border-gold/40 transition-colors"
|
|
3177
3215
|
)
|
|
3178
3216
|
},
|
|
3179
|
-
actions && /* @__PURE__ */
|
|
3180
|
-
/* @__PURE__ */
|
|
3217
|
+
actions && /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement("div", { className: "flex items-center gap-1 px-1 py-1" }, actions), /* @__PURE__ */ import_react48.default.createElement("div", { className: "w-px self-stretch bg-ash/40" })),
|
|
3218
|
+
/* @__PURE__ */ import_react48.default.createElement(
|
|
3181
3219
|
"button",
|
|
3182
3220
|
{
|
|
3183
3221
|
onClick: onClose,
|
|
3184
3222
|
"aria-label": "Close",
|
|
3185
3223
|
className: "p-2 text-silver hover:text-white hover:bg-ash/20 transition-colors"
|
|
3186
3224
|
},
|
|
3187
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__PURE__ */ import_react48.default.createElement(CloseIcon, { className: "w-5 h-5" })
|
|
3188
3226
|
)
|
|
3189
3227
|
),
|
|
3190
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ import_react48.default.createElement(
|
|
3191
3229
|
"div",
|
|
3192
3230
|
{
|
|
3193
3231
|
className: "relative w-11/12 h-11/12 max-w-7xl flex items-center justify-center animate-lightbox-in",
|
|
@@ -3195,12 +3233,12 @@ function Lightbox({
|
|
|
3195
3233
|
},
|
|
3196
3234
|
children
|
|
3197
3235
|
),
|
|
3198
|
-
caption && /* @__PURE__ */
|
|
3236
|
+
caption && /* @__PURE__ */ import_react48.default.createElement("div", { className: "absolute bottom-6 left-0 right-0 text-center pointer-events-none px-4" }, caption)
|
|
3199
3237
|
);
|
|
3200
3238
|
}
|
|
3201
3239
|
|
|
3202
3240
|
// src/components/Drawer.tsx
|
|
3203
|
-
var
|
|
3241
|
+
var import_react49 = __toESM(require("react"));
|
|
3204
3242
|
var import_react_dom3 = require("react-dom");
|
|
3205
3243
|
var import_lucide_react7 = require("lucide-react");
|
|
3206
3244
|
var SIZE_MAP2 = {
|
|
@@ -3256,8 +3294,8 @@ var Drawer = ({
|
|
|
3256
3294
|
children,
|
|
3257
3295
|
className
|
|
3258
3296
|
}) => {
|
|
3259
|
-
const [mounted, setMounted] = (0,
|
|
3260
|
-
(0,
|
|
3297
|
+
const [mounted, setMounted] = (0, import_react49.useState)(false);
|
|
3298
|
+
(0, import_react49.useEffect)(() => {
|
|
3261
3299
|
setMounted(true);
|
|
3262
3300
|
}, []);
|
|
3263
3301
|
useScrollLock(isOpen);
|
|
@@ -3265,7 +3303,7 @@ var Drawer = ({
|
|
|
3265
3303
|
if (!mounted) {
|
|
3266
3304
|
return null;
|
|
3267
3305
|
}
|
|
3268
|
-
const content = /* @__PURE__ */
|
|
3306
|
+
const content = /* @__PURE__ */ import_react49.default.createElement(
|
|
3269
3307
|
"div",
|
|
3270
3308
|
{
|
|
3271
3309
|
className: cx(
|
|
@@ -3273,7 +3311,7 @@ var Drawer = ({
|
|
|
3273
3311
|
isOpen ? "pointer-events-auto" : "pointer-events-none"
|
|
3274
3312
|
)
|
|
3275
3313
|
},
|
|
3276
|
-
/* @__PURE__ */
|
|
3314
|
+
/* @__PURE__ */ import_react49.default.createElement(
|
|
3277
3315
|
"div",
|
|
3278
3316
|
{
|
|
3279
3317
|
className: cx(
|
|
@@ -3284,7 +3322,7 @@ var Drawer = ({
|
|
|
3284
3322
|
"aria-hidden": "true"
|
|
3285
3323
|
}
|
|
3286
3324
|
),
|
|
3287
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ import_react49.default.createElement(
|
|
3288
3326
|
"div",
|
|
3289
3327
|
{
|
|
3290
3328
|
role: "dialog",
|
|
@@ -3302,16 +3340,16 @@ var Drawer = ({
|
|
|
3302
3340
|
className
|
|
3303
3341
|
)
|
|
3304
3342
|
},
|
|
3305
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ import_react49.default.createElement("div", { className: "flex items-center justify-between px-4 py-3 border-b border-ash" }, title ? /* @__PURE__ */ import_react49.default.createElement("h2", { className: "text-lg font-semibold text-white m-0" }, title) : /* @__PURE__ */ import_react49.default.createElement("div", null), /* @__PURE__ */ import_react49.default.createElement(
|
|
3306
3344
|
"button",
|
|
3307
3345
|
{
|
|
3308
3346
|
onClick: onClose,
|
|
3309
3347
|
className: "text-silver hover:text-white transition-colors"
|
|
3310
3348
|
},
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
/* @__PURE__ */
|
|
3349
|
+
/* @__PURE__ */ import_react49.default.createElement(import_lucide_react7.X, { className: "h-5 w-5" }),
|
|
3350
|
+
/* @__PURE__ */ import_react49.default.createElement("span", { className: "sr-only" }, "Close")
|
|
3313
3351
|
)),
|
|
3314
|
-
/* @__PURE__ */
|
|
3352
|
+
/* @__PURE__ */ import_react49.default.createElement("div", { className: "flex-1 overflow-auto p-4" }, children)
|
|
3315
3353
|
)
|
|
3316
3354
|
);
|
|
3317
3355
|
return (0, import_react_dom3.createPortal)(content, document.body);
|
|
@@ -3319,7 +3357,7 @@ var Drawer = ({
|
|
|
3319
3357
|
Drawer.displayName = "Drawer";
|
|
3320
3358
|
|
|
3321
3359
|
// src/components/Popover.tsx
|
|
3322
|
-
var
|
|
3360
|
+
var import_react50 = __toESM(require("react"));
|
|
3323
3361
|
var POSITION_CLASSES3 = {
|
|
3324
3362
|
top: {
|
|
3325
3363
|
start: "bottom-full left-0 mb-2",
|
|
@@ -3351,12 +3389,12 @@ var Popover = ({
|
|
|
3351
3389
|
onOpenChange,
|
|
3352
3390
|
closeOnClickOutside = true
|
|
3353
3391
|
}) => {
|
|
3354
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3392
|
+
const [internalOpen, setInternalOpen] = (0, import_react50.useState)(false);
|
|
3355
3393
|
const isControlled = controlledOpen !== void 0;
|
|
3356
3394
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
3357
|
-
const containerRef = (0,
|
|
3358
|
-
const baseId = (0,
|
|
3359
|
-
const setIsOpen = (0,
|
|
3395
|
+
const containerRef = (0, import_react50.useRef)(null);
|
|
3396
|
+
const baseId = (0, import_react50.useId)();
|
|
3397
|
+
const setIsOpen = (0, import_react50.useCallback)(
|
|
3360
3398
|
(newOpen) => {
|
|
3361
3399
|
if (!isControlled) {
|
|
3362
3400
|
setInternalOpen(newOpen);
|
|
@@ -3365,20 +3403,20 @@ var Popover = ({
|
|
|
3365
3403
|
},
|
|
3366
3404
|
[isControlled, onOpenChange]
|
|
3367
3405
|
);
|
|
3368
|
-
const close = (0,
|
|
3406
|
+
const close = (0, import_react50.useCallback)(() => setIsOpen(false), [setIsOpen]);
|
|
3369
3407
|
useClickOutside(containerRef, close, isOpen && closeOnClickOutside);
|
|
3370
3408
|
useEscapeKey(close, isOpen);
|
|
3371
3409
|
const handleTriggerClick = () => {
|
|
3372
3410
|
setIsOpen(!isOpen);
|
|
3373
3411
|
};
|
|
3374
|
-
const triggerElement =
|
|
3412
|
+
const triggerElement = import_react50.default.cloneElement(trigger, {
|
|
3375
3413
|
onClick: handleTriggerClick,
|
|
3376
3414
|
"aria-haspopup": "dialog",
|
|
3377
3415
|
"aria-expanded": isOpen,
|
|
3378
3416
|
"aria-controls": `${baseId}-popover`,
|
|
3379
3417
|
id: `${baseId}-trigger`
|
|
3380
3418
|
});
|
|
3381
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ import_react50.default.createElement("div", { ref: containerRef, className: "relative inline-block" }, triggerElement, isOpen && /* @__PURE__ */ import_react50.default.createElement(
|
|
3382
3420
|
"div",
|
|
3383
3421
|
{
|
|
3384
3422
|
id: `${baseId}-popover`,
|
|
@@ -3397,7 +3435,7 @@ var Popover = ({
|
|
|
3397
3435
|
Popover.displayName = "Popover";
|
|
3398
3436
|
|
|
3399
3437
|
// src/components/Dialog.tsx
|
|
3400
|
-
var
|
|
3438
|
+
var import_react51 = __toESM(require("react"));
|
|
3401
3439
|
var ConfirmDialog = ({
|
|
3402
3440
|
title = "Confirm",
|
|
3403
3441
|
description,
|
|
@@ -3410,15 +3448,15 @@ var ConfirmDialog = ({
|
|
|
3410
3448
|
isLoading = false,
|
|
3411
3449
|
...props
|
|
3412
3450
|
}) => {
|
|
3413
|
-
const handleCancel = (0,
|
|
3451
|
+
const handleCancel = (0, import_react51.useCallback)(() => {
|
|
3414
3452
|
onCancel?.();
|
|
3415
3453
|
onClose();
|
|
3416
3454
|
}, [onCancel, onClose]);
|
|
3417
|
-
const handleConfirm = (0,
|
|
3455
|
+
const handleConfirm = (0, import_react51.useCallback)(async () => {
|
|
3418
3456
|
await onConfirm();
|
|
3419
3457
|
onClose();
|
|
3420
3458
|
}, [onConfirm, onClose]);
|
|
3421
|
-
return /* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ import_react51.default.createElement(Modal, { title, onClose, ...props }, description && /* @__PURE__ */ import_react51.default.createElement("p", { className: "text-sm text-silver mb-6" }, description), /* @__PURE__ */ import_react51.default.createElement("div", { className: "flex justify-end gap-3" }, /* @__PURE__ */ import_react51.default.createElement(Button, { variant: "outlined", onClick: handleCancel, disabled: isLoading }, cancelText), /* @__PURE__ */ import_react51.default.createElement(
|
|
3422
3460
|
Button,
|
|
3423
3461
|
{
|
|
3424
3462
|
variant: confirmVariant,
|
|
@@ -3441,7 +3479,7 @@ var AlertDialog = ({
|
|
|
3441
3479
|
variant === "warning" && "text-warning",
|
|
3442
3480
|
variant === "error" && "text-error"
|
|
3443
3481
|
);
|
|
3444
|
-
return /* @__PURE__ */
|
|
3482
|
+
return /* @__PURE__ */ import_react51.default.createElement(Modal, { onClose, ...props }, /* @__PURE__ */ import_react51.default.createElement("h3", { className: cx("text-xl font-semibold mb-2", titleClass) }, title), description && /* @__PURE__ */ import_react51.default.createElement("p", { className: "text-sm text-silver mb-6" }, description), /* @__PURE__ */ import_react51.default.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ import_react51.default.createElement(Button, { variant: "primary", onClick: onClose }, acknowledgeText)));
|
|
3445
3483
|
};
|
|
3446
3484
|
AlertDialog.displayName = "AlertDialog";
|
|
3447
3485
|
var PromptDialog = ({
|
|
@@ -3457,12 +3495,12 @@ var PromptDialog = ({
|
|
|
3457
3495
|
isLoading = false,
|
|
3458
3496
|
...props
|
|
3459
3497
|
}) => {
|
|
3460
|
-
const [value, setValue] =
|
|
3461
|
-
const handleCancel = (0,
|
|
3498
|
+
const [value, setValue] = import_react51.default.useState(defaultValue);
|
|
3499
|
+
const handleCancel = (0, import_react51.useCallback)(() => {
|
|
3462
3500
|
onCancel?.();
|
|
3463
3501
|
onClose();
|
|
3464
3502
|
}, [onCancel, onClose]);
|
|
3465
|
-
const handleSubmit = (0,
|
|
3503
|
+
const handleSubmit = (0, import_react51.useCallback)(
|
|
3466
3504
|
async (e) => {
|
|
3467
3505
|
e.preventDefault();
|
|
3468
3506
|
await onSubmit(value);
|
|
@@ -3470,7 +3508,7 @@ var PromptDialog = ({
|
|
|
3470
3508
|
},
|
|
3471
3509
|
[onSubmit, value, onClose]
|
|
3472
3510
|
);
|
|
3473
|
-
return /* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ import_react51.default.createElement(Modal, { title, onClose, ...props }, /* @__PURE__ */ import_react51.default.createElement("form", { onSubmit: handleSubmit }, description && /* @__PURE__ */ import_react51.default.createElement("p", { className: "text-sm text-silver mb-4" }, description), /* @__PURE__ */ import_react51.default.createElement(
|
|
3474
3512
|
"input",
|
|
3475
3513
|
{
|
|
3476
3514
|
type: "text",
|
|
@@ -3485,7 +3523,7 @@ var PromptDialog = ({
|
|
|
3485
3523
|
),
|
|
3486
3524
|
autoFocus: true
|
|
3487
3525
|
}
|
|
3488
|
-
), /* @__PURE__ */
|
|
3526
|
+
), /* @__PURE__ */ import_react51.default.createElement("div", { className: "flex justify-end gap-3" }, /* @__PURE__ */ import_react51.default.createElement(
|
|
3489
3527
|
Button,
|
|
3490
3528
|
{
|
|
3491
3529
|
type: "button",
|
|
@@ -3494,27 +3532,27 @@ var PromptDialog = ({
|
|
|
3494
3532
|
disabled: isLoading
|
|
3495
3533
|
},
|
|
3496
3534
|
cancelText
|
|
3497
|
-
), /* @__PURE__ */
|
|
3535
|
+
), /* @__PURE__ */ import_react51.default.createElement(Button, { type: "submit", variant: "important", loading: isLoading }, submitText))));
|
|
3498
3536
|
};
|
|
3499
3537
|
PromptDialog.displayName = "PromptDialog";
|
|
3500
3538
|
|
|
3501
3539
|
// src/components/Tabs.tsx
|
|
3502
|
-
var
|
|
3503
|
-
var TabsContext = (0,
|
|
3540
|
+
var import_react52 = __toESM(require("react"));
|
|
3541
|
+
var TabsContext = (0, import_react52.createContext)(null);
|
|
3504
3542
|
function useTabsContext() {
|
|
3505
|
-
const context = (0,
|
|
3543
|
+
const context = (0, import_react52.useContext)(TabsContext);
|
|
3506
3544
|
if (!context) {
|
|
3507
3545
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
3508
3546
|
}
|
|
3509
3547
|
return context;
|
|
3510
3548
|
}
|
|
3511
|
-
var Tabs =
|
|
3549
|
+
var Tabs = import_react52.default.forwardRef(
|
|
3512
3550
|
({ defaultValue, value, onValueChange, children, className, ...props }, ref) => {
|
|
3513
|
-
const [internalValue, setInternalValue] = (0,
|
|
3551
|
+
const [internalValue, setInternalValue] = (0, import_react52.useState)(defaultValue ?? "");
|
|
3514
3552
|
const isControlled = value !== void 0;
|
|
3515
3553
|
const activeTab = isControlled ? value : internalValue;
|
|
3516
|
-
const baseId = (0,
|
|
3517
|
-
const setActiveTab = (0,
|
|
3554
|
+
const baseId = (0, import_react52.useId)();
|
|
3555
|
+
const setActiveTab = (0, import_react52.useCallback)(
|
|
3518
3556
|
(id) => {
|
|
3519
3557
|
if (!isControlled) {
|
|
3520
3558
|
setInternalValue(id);
|
|
@@ -3523,13 +3561,13 @@ var Tabs = import_react51.default.forwardRef(
|
|
|
3523
3561
|
},
|
|
3524
3562
|
[isControlled, onValueChange]
|
|
3525
3563
|
);
|
|
3526
|
-
return /* @__PURE__ */
|
|
3564
|
+
return /* @__PURE__ */ import_react52.default.createElement(TabsContext.Provider, { value: { activeTab, setActiveTab, baseId } }, /* @__PURE__ */ import_react52.default.createElement("div", { ref, className: cx("w-full", className), ...props }, children));
|
|
3527
3565
|
}
|
|
3528
3566
|
);
|
|
3529
3567
|
Tabs.displayName = "Tabs";
|
|
3530
|
-
var TabList =
|
|
3568
|
+
var TabList = import_react52.default.forwardRef(
|
|
3531
3569
|
({ children, className, ...props }, ref) => {
|
|
3532
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3533
3571
|
"div",
|
|
3534
3572
|
{
|
|
3535
3573
|
ref,
|
|
@@ -3545,13 +3583,13 @@ var TabList = import_react51.default.forwardRef(
|
|
|
3545
3583
|
}
|
|
3546
3584
|
);
|
|
3547
3585
|
TabList.displayName = "TabList";
|
|
3548
|
-
var Tab =
|
|
3586
|
+
var Tab = import_react52.default.forwardRef(
|
|
3549
3587
|
({ value, children, className, disabled, ...props }, ref) => {
|
|
3550
3588
|
const { activeTab, setActiveTab, baseId } = useTabsContext();
|
|
3551
3589
|
const isActive = activeTab === value;
|
|
3552
3590
|
const panelId = `${baseId}-panel-${value}`;
|
|
3553
3591
|
const tabId = `${baseId}-tab-${value}`;
|
|
3554
|
-
return /* @__PURE__ */
|
|
3592
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3555
3593
|
"button",
|
|
3556
3594
|
{
|
|
3557
3595
|
ref,
|
|
@@ -3578,7 +3616,7 @@ var Tab = import_react51.default.forwardRef(
|
|
|
3578
3616
|
}
|
|
3579
3617
|
);
|
|
3580
3618
|
Tab.displayName = "Tab";
|
|
3581
|
-
var TabPanel =
|
|
3619
|
+
var TabPanel = import_react52.default.forwardRef(
|
|
3582
3620
|
({ value, forceMount = false, children, className, ...props }, ref) => {
|
|
3583
3621
|
const { activeTab, baseId } = useTabsContext();
|
|
3584
3622
|
const isActive = activeTab === value;
|
|
@@ -3587,7 +3625,7 @@ var TabPanel = import_react51.default.forwardRef(
|
|
|
3587
3625
|
if (!isActive && !forceMount) {
|
|
3588
3626
|
return null;
|
|
3589
3627
|
}
|
|
3590
|
-
return /* @__PURE__ */
|
|
3628
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
3591
3629
|
"div",
|
|
3592
3630
|
{
|
|
3593
3631
|
ref,
|
|
@@ -3610,19 +3648,19 @@ var TabPanel = import_react51.default.forwardRef(
|
|
|
3610
3648
|
TabPanel.displayName = "TabPanel";
|
|
3611
3649
|
|
|
3612
3650
|
// src/components/Accordion.tsx
|
|
3613
|
-
var
|
|
3651
|
+
var import_react53 = __toESM(require("react"));
|
|
3614
3652
|
var import_lucide_react8 = require("lucide-react");
|
|
3615
|
-
var AccordionContext = (0,
|
|
3653
|
+
var AccordionContext = (0, import_react53.createContext)(null);
|
|
3616
3654
|
function useAccordionContext() {
|
|
3617
|
-
const context = (0,
|
|
3655
|
+
const context = (0, import_react53.useContext)(AccordionContext);
|
|
3618
3656
|
if (!context) {
|
|
3619
3657
|
throw new Error("Accordion components must be used within an Accordion provider");
|
|
3620
3658
|
}
|
|
3621
3659
|
return context;
|
|
3622
3660
|
}
|
|
3623
|
-
var Accordion =
|
|
3661
|
+
var Accordion = import_react53.default.forwardRef(
|
|
3624
3662
|
({ type = "single", defaultValue, value, onValueChange, children, className, ...props }, ref) => {
|
|
3625
|
-
const [internalValue, setInternalValue] = (0,
|
|
3663
|
+
const [internalValue, setInternalValue] = (0, import_react53.useState)(() => {
|
|
3626
3664
|
if (defaultValue) {
|
|
3627
3665
|
return new Set(Array.isArray(defaultValue) ? defaultValue : [defaultValue]);
|
|
3628
3666
|
}
|
|
@@ -3630,7 +3668,7 @@ var Accordion = import_react52.default.forwardRef(
|
|
|
3630
3668
|
});
|
|
3631
3669
|
const isControlled = value !== void 0;
|
|
3632
3670
|
const expandedItems = isControlled ? new Set(Array.isArray(value) ? value : [value]) : internalValue;
|
|
3633
|
-
const toggleItem = (0,
|
|
3671
|
+
const toggleItem = (0, import_react53.useCallback)(
|
|
3634
3672
|
(id) => {
|
|
3635
3673
|
const newSet = new Set(expandedItems);
|
|
3636
3674
|
if (newSet.has(id)) {
|
|
@@ -3649,7 +3687,7 @@ var Accordion = import_react52.default.forwardRef(
|
|
|
3649
3687
|
},
|
|
3650
3688
|
[expandedItems, type, isControlled, onValueChange]
|
|
3651
3689
|
);
|
|
3652
|
-
return /* @__PURE__ */
|
|
3690
|
+
return /* @__PURE__ */ import_react53.default.createElement(AccordionContext.Provider, { value: { expandedItems, toggleItem, type } }, /* @__PURE__ */ import_react53.default.createElement(
|
|
3653
3691
|
"div",
|
|
3654
3692
|
{
|
|
3655
3693
|
ref,
|
|
@@ -3661,10 +3699,10 @@ var Accordion = import_react52.default.forwardRef(
|
|
|
3661
3699
|
}
|
|
3662
3700
|
);
|
|
3663
3701
|
Accordion.displayName = "Accordion";
|
|
3664
|
-
var AccordionItemContext = (0,
|
|
3665
|
-
var AccordionItem =
|
|
3702
|
+
var AccordionItemContext = (0, import_react53.createContext)(null);
|
|
3703
|
+
var AccordionItem = import_react53.default.forwardRef(
|
|
3666
3704
|
({ value, disabled = false, children, className, ...props }, ref) => {
|
|
3667
|
-
return /* @__PURE__ */
|
|
3705
|
+
return /* @__PURE__ */ import_react53.default.createElement(AccordionItemContext.Provider, { value: { value, disabled } }, /* @__PURE__ */ import_react53.default.createElement(
|
|
3668
3706
|
"div",
|
|
3669
3707
|
{
|
|
3670
3708
|
ref,
|
|
@@ -3677,17 +3715,17 @@ var AccordionItem = import_react52.default.forwardRef(
|
|
|
3677
3715
|
}
|
|
3678
3716
|
);
|
|
3679
3717
|
AccordionItem.displayName = "AccordionItem";
|
|
3680
|
-
var AccordionTrigger =
|
|
3718
|
+
var AccordionTrigger = import_react53.default.forwardRef(
|
|
3681
3719
|
({ children, className, ...props }, ref) => {
|
|
3682
3720
|
const { expandedItems, toggleItem } = useAccordionContext();
|
|
3683
|
-
const itemContext = (0,
|
|
3684
|
-
const baseId = (0,
|
|
3721
|
+
const itemContext = (0, import_react53.useContext)(AccordionItemContext);
|
|
3722
|
+
const baseId = (0, import_react53.useId)();
|
|
3685
3723
|
if (!itemContext) {
|
|
3686
3724
|
throw new Error("AccordionTrigger must be used within an AccordionItem");
|
|
3687
3725
|
}
|
|
3688
3726
|
const { value, disabled } = itemContext;
|
|
3689
3727
|
const isExpanded = expandedItems.has(value);
|
|
3690
|
-
return /* @__PURE__ */
|
|
3728
|
+
return /* @__PURE__ */ import_react53.default.createElement("h3", { className: "m-0" }, /* @__PURE__ */ import_react53.default.createElement(
|
|
3691
3729
|
"button",
|
|
3692
3730
|
{
|
|
3693
3731
|
ref,
|
|
@@ -3708,8 +3746,8 @@ var AccordionTrigger = import_react52.default.forwardRef(
|
|
|
3708
3746
|
),
|
|
3709
3747
|
...props
|
|
3710
3748
|
},
|
|
3711
|
-
/* @__PURE__ */
|
|
3712
|
-
/* @__PURE__ */
|
|
3749
|
+
/* @__PURE__ */ import_react53.default.createElement("span", null, children),
|
|
3750
|
+
/* @__PURE__ */ import_react53.default.createElement(
|
|
3713
3751
|
import_lucide_react8.ChevronDown,
|
|
3714
3752
|
{
|
|
3715
3753
|
className: cx(
|
|
@@ -3722,17 +3760,17 @@ var AccordionTrigger = import_react52.default.forwardRef(
|
|
|
3722
3760
|
}
|
|
3723
3761
|
);
|
|
3724
3762
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
3725
|
-
var AccordionContent =
|
|
3763
|
+
var AccordionContent = import_react53.default.forwardRef(
|
|
3726
3764
|
({ children, className, ...props }, ref) => {
|
|
3727
3765
|
const { expandedItems } = useAccordionContext();
|
|
3728
|
-
const itemContext = (0,
|
|
3729
|
-
const baseId = (0,
|
|
3766
|
+
const itemContext = (0, import_react53.useContext)(AccordionItemContext);
|
|
3767
|
+
const baseId = (0, import_react53.useId)();
|
|
3730
3768
|
if (!itemContext) {
|
|
3731
3769
|
throw new Error("AccordionContent must be used within an AccordionItem");
|
|
3732
3770
|
}
|
|
3733
3771
|
const { value } = itemContext;
|
|
3734
3772
|
const isExpanded = expandedItems.has(value);
|
|
3735
|
-
return /* @__PURE__ */
|
|
3773
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
3736
3774
|
"div",
|
|
3737
3775
|
{
|
|
3738
3776
|
ref,
|
|
@@ -3747,28 +3785,28 @@ var AccordionContent = import_react52.default.forwardRef(
|
|
|
3747
3785
|
),
|
|
3748
3786
|
...props
|
|
3749
3787
|
},
|
|
3750
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ import_react53.default.createElement("div", { className: "px-4 pb-4 text-sm text-silver" }, children)
|
|
3751
3789
|
);
|
|
3752
3790
|
}
|
|
3753
3791
|
);
|
|
3754
3792
|
AccordionContent.displayName = "AccordionContent";
|
|
3755
3793
|
|
|
3756
3794
|
// src/components/Menu.tsx
|
|
3757
|
-
var
|
|
3758
|
-
var MenuContext = (0,
|
|
3795
|
+
var import_react54 = __toESM(require("react"));
|
|
3796
|
+
var MenuContext = (0, import_react54.createContext)(null);
|
|
3759
3797
|
function useMenuContext() {
|
|
3760
|
-
const context = (0,
|
|
3798
|
+
const context = (0, import_react54.useContext)(MenuContext);
|
|
3761
3799
|
if (!context) {
|
|
3762
3800
|
throw new Error("Menu components must be used within a Menu provider");
|
|
3763
3801
|
}
|
|
3764
3802
|
return context;
|
|
3765
3803
|
}
|
|
3766
3804
|
var Menu = ({ children, open, onOpenChange }) => {
|
|
3767
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
3805
|
+
const [internalOpen, setInternalOpen] = (0, import_react54.useState)(false);
|
|
3768
3806
|
const isControlled = open !== void 0;
|
|
3769
3807
|
const isOpen = isControlled ? open : internalOpen;
|
|
3770
|
-
const baseId = (0,
|
|
3771
|
-
const setIsOpen = (0,
|
|
3808
|
+
const baseId = (0, import_react54.useId)();
|
|
3809
|
+
const setIsOpen = (0, import_react54.useCallback)(
|
|
3772
3810
|
(newOpen) => {
|
|
3773
3811
|
if (!isControlled) {
|
|
3774
3812
|
setInternalOpen(newOpen);
|
|
@@ -3777,7 +3815,7 @@ var Menu = ({ children, open, onOpenChange }) => {
|
|
|
3777
3815
|
},
|
|
3778
3816
|
[isControlled, onOpenChange]
|
|
3779
3817
|
);
|
|
3780
|
-
return /* @__PURE__ */
|
|
3818
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
3781
3819
|
MenuContext.Provider,
|
|
3782
3820
|
{
|
|
3783
3821
|
value: {
|
|
@@ -3787,11 +3825,11 @@ var Menu = ({ children, open, onOpenChange }) => {
|
|
|
3787
3825
|
menuId: `${baseId}-menu`
|
|
3788
3826
|
}
|
|
3789
3827
|
},
|
|
3790
|
-
/* @__PURE__ */
|
|
3828
|
+
/* @__PURE__ */ import_react54.default.createElement("div", { className: "relative inline-block" }, children)
|
|
3791
3829
|
);
|
|
3792
3830
|
};
|
|
3793
3831
|
Menu.displayName = "Menu";
|
|
3794
|
-
var MenuTrigger =
|
|
3832
|
+
var MenuTrigger = import_react54.default.forwardRef(
|
|
3795
3833
|
({ children, className, asChild, ...props }, ref) => {
|
|
3796
3834
|
const { isOpen, setIsOpen, triggerId, menuId } = useMenuContext();
|
|
3797
3835
|
const handleClick = (e) => {
|
|
@@ -3799,7 +3837,7 @@ var MenuTrigger = import_react53.default.forwardRef(
|
|
|
3799
3837
|
setIsOpen(!isOpen);
|
|
3800
3838
|
props.onClick?.(e);
|
|
3801
3839
|
};
|
|
3802
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
3803
3841
|
"button",
|
|
3804
3842
|
{
|
|
3805
3843
|
ref,
|
|
@@ -3829,13 +3867,13 @@ var MENU_SIDE_CLASSES = {
|
|
|
3829
3867
|
top: "bottom-full mb-1",
|
|
3830
3868
|
bottom: "top-full mt-1"
|
|
3831
3869
|
};
|
|
3832
|
-
var MenuContent =
|
|
3870
|
+
var MenuContent = import_react54.default.forwardRef(
|
|
3833
3871
|
({ children, className, align = "start", side = "bottom", ...props }, ref) => {
|
|
3834
3872
|
const { isOpen, setIsOpen, triggerId, menuId } = useMenuContext();
|
|
3835
|
-
const menuRef = (0,
|
|
3836
|
-
const close = (0,
|
|
3873
|
+
const menuRef = (0, import_react54.useRef)(null);
|
|
3874
|
+
const close = (0, import_react54.useCallback)(() => setIsOpen(false), [setIsOpen]);
|
|
3837
3875
|
useEscapeKey(close, isOpen);
|
|
3838
|
-
(0,
|
|
3876
|
+
(0, import_react54.useEffect)(() => {
|
|
3839
3877
|
if (!isOpen) {
|
|
3840
3878
|
return;
|
|
3841
3879
|
}
|
|
@@ -3852,7 +3890,7 @@ var MenuContent = import_react53.default.forwardRef(
|
|
|
3852
3890
|
if (!isOpen) {
|
|
3853
3891
|
return null;
|
|
3854
3892
|
}
|
|
3855
|
-
return /* @__PURE__ */
|
|
3893
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
3856
3894
|
"div",
|
|
3857
3895
|
{
|
|
3858
3896
|
ref: composeRefs(menuRef, ref),
|
|
@@ -3874,7 +3912,7 @@ var MenuContent = import_react53.default.forwardRef(
|
|
|
3874
3912
|
}
|
|
3875
3913
|
);
|
|
3876
3914
|
MenuContent.displayName = "MenuContent";
|
|
3877
|
-
var MenuItem =
|
|
3915
|
+
var MenuItem = import_react54.default.forwardRef(
|
|
3878
3916
|
({ children, className, icon, destructive, disabled, onClick, ...props }, ref) => {
|
|
3879
3917
|
const { setIsOpen } = useMenuContext();
|
|
3880
3918
|
const handleClick = (e) => {
|
|
@@ -3884,7 +3922,7 @@ var MenuItem = import_react53.default.forwardRef(
|
|
|
3884
3922
|
onClick?.(e);
|
|
3885
3923
|
setIsOpen(false);
|
|
3886
3924
|
};
|
|
3887
|
-
return /* @__PURE__ */
|
|
3925
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
3888
3926
|
"button",
|
|
3889
3927
|
{
|
|
3890
3928
|
ref,
|
|
@@ -3902,13 +3940,13 @@ var MenuItem = import_react53.default.forwardRef(
|
|
|
3902
3940
|
),
|
|
3903
3941
|
...props
|
|
3904
3942
|
},
|
|
3905
|
-
icon && /* @__PURE__ */
|
|
3943
|
+
icon && /* @__PURE__ */ import_react54.default.createElement("span", { className: "w-4 h-4 shrink-0" }, icon),
|
|
3906
3944
|
children
|
|
3907
3945
|
);
|
|
3908
3946
|
}
|
|
3909
3947
|
);
|
|
3910
3948
|
MenuItem.displayName = "MenuItem";
|
|
3911
|
-
var MenuSeparator =
|
|
3949
|
+
var MenuSeparator = import_react54.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react54.default.createElement(
|
|
3912
3950
|
"div",
|
|
3913
3951
|
{
|
|
3914
3952
|
ref,
|
|
@@ -3918,7 +3956,7 @@ var MenuSeparator = import_react53.default.forwardRef(({ className, ...props },
|
|
|
3918
3956
|
}
|
|
3919
3957
|
));
|
|
3920
3958
|
MenuSeparator.displayName = "MenuSeparator";
|
|
3921
|
-
var MenuLabel =
|
|
3959
|
+
var MenuLabel = import_react54.default.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ import_react54.default.createElement(
|
|
3922
3960
|
"div",
|
|
3923
3961
|
{
|
|
3924
3962
|
ref,
|
|
@@ -3930,10 +3968,10 @@ var MenuLabel = import_react53.default.forwardRef(({ className, children, ...pro
|
|
|
3930
3968
|
MenuLabel.displayName = "MenuLabel";
|
|
3931
3969
|
|
|
3932
3970
|
// src/components/Navbar.tsx
|
|
3933
|
-
var
|
|
3934
|
-
var Navbar =
|
|
3971
|
+
var import_react55 = __toESM(require("react"));
|
|
3972
|
+
var Navbar = import_react55.default.forwardRef(
|
|
3935
3973
|
({ fixed = false, bordered = true, className, children, ...props }, ref) => {
|
|
3936
|
-
return /* @__PURE__ */
|
|
3974
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
3937
3975
|
"nav",
|
|
3938
3976
|
{
|
|
3939
3977
|
ref,
|
|
@@ -3945,14 +3983,14 @@ var Navbar = import_react54.default.forwardRef(
|
|
|
3945
3983
|
),
|
|
3946
3984
|
...props
|
|
3947
3985
|
},
|
|
3948
|
-
/* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ import_react55.default.createElement("div", { className: "flex items-center justify-between" }, children)
|
|
3949
3987
|
);
|
|
3950
3988
|
}
|
|
3951
3989
|
);
|
|
3952
3990
|
Navbar.displayName = "Navbar";
|
|
3953
|
-
var NavbarBrand =
|
|
3991
|
+
var NavbarBrand = import_react55.default.forwardRef(
|
|
3954
3992
|
({ className, children, ...props }, ref) => {
|
|
3955
|
-
return /* @__PURE__ */
|
|
3993
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
3956
3994
|
"div",
|
|
3957
3995
|
{
|
|
3958
3996
|
ref,
|
|
@@ -3964,14 +4002,14 @@ var NavbarBrand = import_react54.default.forwardRef(
|
|
|
3964
4002
|
}
|
|
3965
4003
|
);
|
|
3966
4004
|
NavbarBrand.displayName = "NavbarBrand";
|
|
3967
|
-
var NavbarContent =
|
|
4005
|
+
var NavbarContent = import_react55.default.forwardRef(
|
|
3968
4006
|
({ position = "center", className, children, ...props }, ref) => {
|
|
3969
4007
|
const positionClasses = {
|
|
3970
4008
|
start: "mr-auto",
|
|
3971
4009
|
center: "mx-auto",
|
|
3972
4010
|
end: "ml-auto"
|
|
3973
4011
|
};
|
|
3974
|
-
return /* @__PURE__ */
|
|
4012
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
3975
4013
|
"div",
|
|
3976
4014
|
{
|
|
3977
4015
|
ref,
|
|
@@ -3987,9 +4025,9 @@ var NavbarContent = import_react54.default.forwardRef(
|
|
|
3987
4025
|
}
|
|
3988
4026
|
);
|
|
3989
4027
|
NavbarContent.displayName = "NavbarContent";
|
|
3990
|
-
var NavbarItem =
|
|
4028
|
+
var NavbarItem = import_react55.default.forwardRef(
|
|
3991
4029
|
({ active = false, className, children, ...props }, ref) => {
|
|
3992
|
-
return /* @__PURE__ */
|
|
4030
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
3993
4031
|
"div",
|
|
3994
4032
|
{
|
|
3995
4033
|
ref,
|
|
@@ -4004,9 +4042,9 @@ var NavbarItem = import_react54.default.forwardRef(
|
|
|
4004
4042
|
}
|
|
4005
4043
|
);
|
|
4006
4044
|
NavbarItem.displayName = "NavbarItem";
|
|
4007
|
-
var NavbarLink =
|
|
4045
|
+
var NavbarLink = import_react55.default.forwardRef(
|
|
4008
4046
|
({ active = false, className, children, ...props }, ref) => {
|
|
4009
|
-
return /* @__PURE__ */
|
|
4047
|
+
return /* @__PURE__ */ import_react55.default.createElement(
|
|
4010
4048
|
"a",
|
|
4011
4049
|
{
|
|
4012
4050
|
ref,
|
|
@@ -4022,7 +4060,7 @@ var NavbarLink = import_react54.default.forwardRef(
|
|
|
4022
4060
|
}
|
|
4023
4061
|
);
|
|
4024
4062
|
NavbarLink.displayName = "NavbarLink";
|
|
4025
|
-
var NavbarDivider =
|
|
4063
|
+
var NavbarDivider = import_react55.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ import_react55.default.createElement(
|
|
4026
4064
|
"div",
|
|
4027
4065
|
{
|
|
4028
4066
|
ref,
|
|
@@ -4033,19 +4071,19 @@ var NavbarDivider = import_react54.default.forwardRef(({ className, ...props },
|
|
|
4033
4071
|
NavbarDivider.displayName = "NavbarDivider";
|
|
4034
4072
|
|
|
4035
4073
|
// src/components/Breadcrumb.tsx
|
|
4036
|
-
var
|
|
4074
|
+
var import_react56 = __toESM(require("react"));
|
|
4037
4075
|
var import_lucide_react9 = require("lucide-react");
|
|
4038
|
-
var Breadcrumb =
|
|
4076
|
+
var Breadcrumb = import_react56.default.forwardRef(
|
|
4039
4077
|
({ separator, className, children, ...props }, ref) => {
|
|
4040
|
-
const items =
|
|
4041
|
-
const defaultSeparator = /* @__PURE__ */
|
|
4042
|
-
return /* @__PURE__ */
|
|
4078
|
+
const items = import_react56.default.Children.toArray(children);
|
|
4079
|
+
const defaultSeparator = /* @__PURE__ */ import_react56.default.createElement(import_lucide_react9.ChevronRight, { className: "h-4 w-4 text-ash" });
|
|
4080
|
+
return /* @__PURE__ */ import_react56.default.createElement("nav", { ref, "aria-label": "Breadcrumb", className, ...props }, /* @__PURE__ */ import_react56.default.createElement("ol", { className: "flex items-center gap-2" }, items.map((child, index) => /* @__PURE__ */ import_react56.default.createElement("li", { key: index, className: "flex items-center gap-2" }, child, index < items.length - 1 && /* @__PURE__ */ import_react56.default.createElement("span", { "aria-hidden": "true" }, separator ?? defaultSeparator)))));
|
|
4043
4081
|
}
|
|
4044
4082
|
);
|
|
4045
4083
|
Breadcrumb.displayName = "Breadcrumb";
|
|
4046
|
-
var BreadcrumbItem =
|
|
4084
|
+
var BreadcrumbItem = import_react56.default.forwardRef(
|
|
4047
4085
|
({ current = false, className, children, ...props }, ref) => {
|
|
4048
|
-
return /* @__PURE__ */
|
|
4086
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
4049
4087
|
"span",
|
|
4050
4088
|
{
|
|
4051
4089
|
ref,
|
|
@@ -4062,9 +4100,9 @@ var BreadcrumbItem = import_react55.default.forwardRef(
|
|
|
4062
4100
|
}
|
|
4063
4101
|
);
|
|
4064
4102
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
4065
|
-
var BreadcrumbLink =
|
|
4103
|
+
var BreadcrumbLink = import_react56.default.forwardRef(
|
|
4066
4104
|
({ className, children, ...props }, ref) => {
|
|
4067
|
-
return /* @__PURE__ */
|
|
4105
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
4068
4106
|
"a",
|
|
4069
4107
|
{
|
|
4070
4108
|
ref,
|
|
@@ -4081,7 +4119,7 @@ var BreadcrumbLink = import_react55.default.forwardRef(
|
|
|
4081
4119
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
4082
4120
|
|
|
4083
4121
|
// src/components/Pagination.tsx
|
|
4084
|
-
var
|
|
4122
|
+
var import_react57 = __toESM(require("react"));
|
|
4085
4123
|
var import_lucide_react10 = require("lucide-react");
|
|
4086
4124
|
function generatePagination(currentPage, totalPages, siblingCount) {
|
|
4087
4125
|
const totalSlots = siblingCount * 2 + 5;
|
|
@@ -4111,7 +4149,7 @@ function generatePagination(currentPage, totalPages, siblingCount) {
|
|
|
4111
4149
|
);
|
|
4112
4150
|
return [1, "ellipsis", ...middleRange, "ellipsis", totalPages];
|
|
4113
4151
|
}
|
|
4114
|
-
var Pagination =
|
|
4152
|
+
var Pagination = import_react57.default.forwardRef(
|
|
4115
4153
|
({
|
|
4116
4154
|
page,
|
|
4117
4155
|
totalPages,
|
|
@@ -4123,7 +4161,7 @@ var Pagination = import_react56.default.forwardRef(
|
|
|
4123
4161
|
}, ref) => {
|
|
4124
4162
|
const pages = generatePagination(page, totalPages, siblingCount);
|
|
4125
4163
|
const buttonBaseClass = "flex items-center justify-center h-8 min-w-8 px-2 text-sm border border-ash transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gold";
|
|
4126
|
-
return /* @__PURE__ */
|
|
4164
|
+
return /* @__PURE__ */ import_react57.default.createElement(
|
|
4127
4165
|
"nav",
|
|
4128
4166
|
{
|
|
4129
4167
|
ref,
|
|
@@ -4132,7 +4170,7 @@ var Pagination = import_react56.default.forwardRef(
|
|
|
4132
4170
|
className: cx("flex items-center gap-1", className),
|
|
4133
4171
|
...props
|
|
4134
4172
|
},
|
|
4135
|
-
/* @__PURE__ */
|
|
4173
|
+
/* @__PURE__ */ import_react57.default.createElement(
|
|
4136
4174
|
"button",
|
|
4137
4175
|
{
|
|
4138
4176
|
type: "button",
|
|
@@ -4145,17 +4183,17 @@ var Pagination = import_react56.default.forwardRef(
|
|
|
4145
4183
|
page <= 1 && "opacity-50 cursor-not-allowed hover:border-ash"
|
|
4146
4184
|
)
|
|
4147
4185
|
},
|
|
4148
|
-
/* @__PURE__ */
|
|
4186
|
+
/* @__PURE__ */ import_react57.default.createElement(import_lucide_react10.ChevronLeft, { className: "h-4 w-4" })
|
|
4149
4187
|
),
|
|
4150
4188
|
pages.map(
|
|
4151
|
-
(pageNum, index) => pageNum === "ellipsis" ? /* @__PURE__ */
|
|
4189
|
+
(pageNum, index) => pageNum === "ellipsis" ? /* @__PURE__ */ import_react57.default.createElement(
|
|
4152
4190
|
"span",
|
|
4153
4191
|
{
|
|
4154
4192
|
key: `ellipsis-${index}`,
|
|
4155
4193
|
className: "flex items-center justify-center h-8 w-8 text-silver"
|
|
4156
4194
|
},
|
|
4157
|
-
/* @__PURE__ */
|
|
4158
|
-
) : /* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ import_react57.default.createElement(import_lucide_react10.MoreHorizontal, { className: "h-4 w-4" })
|
|
4196
|
+
) : /* @__PURE__ */ import_react57.default.createElement(
|
|
4159
4197
|
"button",
|
|
4160
4198
|
{
|
|
4161
4199
|
key: pageNum,
|
|
@@ -4171,7 +4209,7 @@ var Pagination = import_react56.default.forwardRef(
|
|
|
4171
4209
|
pageNum
|
|
4172
4210
|
)
|
|
4173
4211
|
),
|
|
4174
|
-
/* @__PURE__ */
|
|
4212
|
+
/* @__PURE__ */ import_react57.default.createElement(
|
|
4175
4213
|
"button",
|
|
4176
4214
|
{
|
|
4177
4215
|
type: "button",
|
|
@@ -4184,7 +4222,7 @@ var Pagination = import_react56.default.forwardRef(
|
|
|
4184
4222
|
page >= totalPages && "opacity-50 cursor-not-allowed hover:border-ash"
|
|
4185
4223
|
)
|
|
4186
4224
|
},
|
|
4187
|
-
/* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ import_react57.default.createElement(import_lucide_react10.ChevronRight, { className: "h-4 w-4" })
|
|
4188
4226
|
)
|
|
4189
4227
|
);
|
|
4190
4228
|
}
|
|
@@ -4192,9 +4230,9 @@ var Pagination = import_react56.default.forwardRef(
|
|
|
4192
4230
|
Pagination.displayName = "Pagination";
|
|
4193
4231
|
|
|
4194
4232
|
// src/components/Stepper.tsx
|
|
4195
|
-
var
|
|
4233
|
+
var import_react58 = __toESM(require("react"));
|
|
4196
4234
|
var import_lucide_react11 = require("lucide-react");
|
|
4197
|
-
var Stepper =
|
|
4235
|
+
var Stepper = import_react58.default.forwardRef(
|
|
4198
4236
|
({ steps, currentStep, status, className, ...rest }, ref) => {
|
|
4199
4237
|
const currentIndex = steps.findIndex((step) => step.id === currentStep);
|
|
4200
4238
|
const getStepState = (index) => {
|
|
@@ -4206,7 +4244,7 @@ var Stepper = import_react57.default.forwardRef(
|
|
|
4206
4244
|
}
|
|
4207
4245
|
return "future";
|
|
4208
4246
|
};
|
|
4209
|
-
return /* @__PURE__ */
|
|
4247
|
+
return /* @__PURE__ */ import_react58.default.createElement(
|
|
4210
4248
|
"div",
|
|
4211
4249
|
{
|
|
4212
4250
|
ref,
|
|
@@ -4216,7 +4254,7 @@ var Stepper = import_react57.default.forwardRef(
|
|
|
4216
4254
|
steps.map((step, index) => {
|
|
4217
4255
|
const state = getStepState(index);
|
|
4218
4256
|
const isLast = index === steps.length - 1;
|
|
4219
|
-
return /* @__PURE__ */
|
|
4257
|
+
return /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, { key: step.id }, /* @__PURE__ */ import_react58.default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ import_react58.default.createElement(
|
|
4220
4258
|
"div",
|
|
4221
4259
|
{
|
|
4222
4260
|
className: cx(
|
|
@@ -4227,8 +4265,8 @@ var Stepper = import_react57.default.forwardRef(
|
|
|
4227
4265
|
state === "future" && "bg-charcoal border-ash text-silver"
|
|
4228
4266
|
)
|
|
4229
4267
|
},
|
|
4230
|
-
state === "complete" ? /* @__PURE__ */
|
|
4231
|
-
), /* @__PURE__ */
|
|
4268
|
+
state === "complete" ? /* @__PURE__ */ import_react58.default.createElement(import_lucide_react11.Check, { className: "h-5 w-5" }) : /* @__PURE__ */ import_react58.default.createElement("span", null, index + 1)
|
|
4269
|
+
), /* @__PURE__ */ import_react58.default.createElement(
|
|
4232
4270
|
"span",
|
|
4233
4271
|
{
|
|
4234
4272
|
className: cx(
|
|
@@ -4240,7 +4278,7 @@ var Stepper = import_react57.default.forwardRef(
|
|
|
4240
4278
|
)
|
|
4241
4279
|
},
|
|
4242
4280
|
step.label
|
|
4243
|
-
)), !isLast && /* @__PURE__ */
|
|
4281
|
+
)), !isLast && /* @__PURE__ */ import_react58.default.createElement(
|
|
4244
4282
|
"div",
|
|
4245
4283
|
{
|
|
4246
4284
|
className: cx(
|
|
@@ -4256,11 +4294,11 @@ var Stepper = import_react57.default.forwardRef(
|
|
|
4256
4294
|
Stepper.displayName = "Stepper";
|
|
4257
4295
|
|
|
4258
4296
|
// src/components/Message.tsx
|
|
4259
|
-
var
|
|
4297
|
+
var import_react60 = __toESM(require("react"));
|
|
4260
4298
|
var import_lucide_react12 = require("lucide-react");
|
|
4261
4299
|
|
|
4262
4300
|
// src/components/MarkdownContent.tsx
|
|
4263
|
-
var
|
|
4301
|
+
var import_react59 = __toESM(require("react"));
|
|
4264
4302
|
var import_react_markdown = __toESM(require("react-markdown"));
|
|
4265
4303
|
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
4266
4304
|
|
|
@@ -4303,7 +4341,7 @@ function remarkMentions() {
|
|
|
4303
4341
|
|
|
4304
4342
|
// src/components/MarkdownContent.tsx
|
|
4305
4343
|
var CURSOR_BASE_CLASSES = "inline-block bg-current animate-cursor-blink w-0.5 h-cursor translate-y-cursor-offset";
|
|
4306
|
-
var MarkdownContent =
|
|
4344
|
+
var MarkdownContent = import_react59.default.forwardRef(
|
|
4307
4345
|
({
|
|
4308
4346
|
className,
|
|
4309
4347
|
content,
|
|
@@ -4314,7 +4352,7 @@ var MarkdownContent = import_react58.default.forwardRef(
|
|
|
4314
4352
|
...rest
|
|
4315
4353
|
}, ref) => {
|
|
4316
4354
|
if (!isMarkdown) {
|
|
4317
|
-
return /* @__PURE__ */
|
|
4355
|
+
return /* @__PURE__ */ import_react59.default.createElement("div", { ref, className: cx("prose whitespace-pre-wrap", className), ...rest }, content, isStreaming && /* @__PURE__ */ import_react59.default.createElement(
|
|
4318
4356
|
"span",
|
|
4319
4357
|
{
|
|
4320
4358
|
"aria-hidden": "true",
|
|
@@ -4325,13 +4363,13 @@ var MarkdownContent = import_react58.default.forwardRef(
|
|
|
4325
4363
|
const components = {
|
|
4326
4364
|
// Harden external links so user-authored URLs don't open in the same tab
|
|
4327
4365
|
// and can't reach `window.opener`.
|
|
4328
|
-
a: ({ href, children }) => /* @__PURE__ */
|
|
4366
|
+
a: ({ href, children }) => /* @__PURE__ */ import_react59.default.createElement("a", { href, target: "_blank", rel: "noopener noreferrer" }, children),
|
|
4329
4367
|
...mentionRenderer && {
|
|
4330
|
-
mention: ({ name }) => /* @__PURE__ */
|
|
4368
|
+
mention: ({ name }) => /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, mentionRenderer(name))
|
|
4331
4369
|
}
|
|
4332
4370
|
};
|
|
4333
4371
|
const remarkPlugins = mentionRenderer ? [import_remark_gfm.default, remarkMentions] : [import_remark_gfm.default];
|
|
4334
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ import_react59.default.createElement("div", { ref, className: cx("prose", className), ...rest }, /* @__PURE__ */ import_react59.default.createElement(import_react_markdown.default, { remarkPlugins, components }, content), isStreaming && /* @__PURE__ */ import_react59.default.createElement(
|
|
4335
4373
|
"span",
|
|
4336
4374
|
{
|
|
4337
4375
|
"aria-hidden": "true",
|
|
@@ -4357,7 +4395,7 @@ var BRANCH_BUTTON_CLASSES = cx(
|
|
|
4357
4395
|
"disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-silver/70"
|
|
4358
4396
|
);
|
|
4359
4397
|
function ActionButton({ onClick, label, children, disabled }) {
|
|
4360
|
-
return /* @__PURE__ */
|
|
4398
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
4361
4399
|
"button",
|
|
4362
4400
|
{
|
|
4363
4401
|
type: "button",
|
|
@@ -4369,7 +4407,7 @@ function ActionButton({ onClick, label, children, disabled }) {
|
|
|
4369
4407
|
children
|
|
4370
4408
|
);
|
|
4371
4409
|
}
|
|
4372
|
-
var Message =
|
|
4410
|
+
var Message = import_react60.default.forwardRef(
|
|
4373
4411
|
({
|
|
4374
4412
|
variant = "assistant",
|
|
4375
4413
|
className,
|
|
@@ -4386,7 +4424,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4386
4424
|
}, ref) => {
|
|
4387
4425
|
const isUser = variant === "user";
|
|
4388
4426
|
const isJumpInteractive = !!onJumpHere && !isActive && !isStreaming;
|
|
4389
|
-
const handleBubbleClick = (0,
|
|
4427
|
+
const handleBubbleClick = (0, import_react60.useCallback)((e) => {
|
|
4390
4428
|
if (!isJumpInteractive) {
|
|
4391
4429
|
return;
|
|
4392
4430
|
}
|
|
@@ -4401,12 +4439,12 @@ var Message = import_react59.default.forwardRef(
|
|
|
4401
4439
|
onJumpHere();
|
|
4402
4440
|
}, [isJumpInteractive, onJumpHere]);
|
|
4403
4441
|
const { copied, copy } = useCopyToClipboard();
|
|
4404
|
-
const [isEditing, setIsEditing] = (0,
|
|
4405
|
-
const [editValue, setEditValue] = (0,
|
|
4406
|
-
const textareaRef = (0,
|
|
4442
|
+
const [isEditing, setIsEditing] = (0, import_react60.useState)(false);
|
|
4443
|
+
const [editValue, setEditValue] = (0, import_react60.useState)(typeof content === "string" ? content : "");
|
|
4444
|
+
const textareaRef = (0, import_react60.useRef)(null);
|
|
4407
4445
|
const showBranchNav = branchInfo && branchInfo.total > 1;
|
|
4408
4446
|
const showActions = actions && !hideActions && !isStreaming;
|
|
4409
|
-
(0,
|
|
4447
|
+
(0, import_react60.useEffect)(() => {
|
|
4410
4448
|
if (isEditing && textareaRef.current) {
|
|
4411
4449
|
const textarea = textareaRef.current;
|
|
4412
4450
|
textarea.style.height = "auto";
|
|
@@ -4415,7 +4453,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4415
4453
|
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
|
|
4416
4454
|
}
|
|
4417
4455
|
}, [isEditing]);
|
|
4418
|
-
const handleCopy = (0,
|
|
4456
|
+
const handleCopy = (0, import_react60.useCallback)(() => {
|
|
4419
4457
|
if (typeof content === "string") {
|
|
4420
4458
|
void copy(content);
|
|
4421
4459
|
}
|
|
@@ -4453,7 +4491,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4453
4491
|
textarea.style.height = "auto";
|
|
4454
4492
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
4455
4493
|
};
|
|
4456
|
-
return /* @__PURE__ */
|
|
4494
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
4457
4495
|
"div",
|
|
4458
4496
|
{
|
|
4459
4497
|
ref,
|
|
@@ -4464,7 +4502,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4464
4502
|
),
|
|
4465
4503
|
...rest
|
|
4466
4504
|
},
|
|
4467
|
-
attachments && attachments.length > 0 && /* @__PURE__ */
|
|
4505
|
+
attachments && attachments.length > 0 && /* @__PURE__ */ import_react60.default.createElement("div", { className: cx("mb-1.5", isUser ? "self-end" : "self-start") }, /* @__PURE__ */ import_react60.default.createElement(
|
|
4468
4506
|
AttachmentPreview,
|
|
4469
4507
|
{
|
|
4470
4508
|
attachments,
|
|
@@ -4472,7 +4510,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4472
4510
|
onOpen: onAttachmentOpen
|
|
4473
4511
|
}
|
|
4474
4512
|
)),
|
|
4475
|
-
isUser && isEditing ? /* @__PURE__ */
|
|
4513
|
+
isUser && isEditing ? /* @__PURE__ */ import_react60.default.createElement("div", { className: "w-full max-w-11/12" }, /* @__PURE__ */ import_react60.default.createElement("div", { className: "relative bg-gold" }, /* @__PURE__ */ import_react60.default.createElement(
|
|
4476
4514
|
"textarea",
|
|
4477
4515
|
{
|
|
4478
4516
|
ref: textareaRef,
|
|
@@ -4482,7 +4520,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4482
4520
|
className: "w-full bg-transparent text-obsidian px-3 py-2 pr-20 resize-none outline-none min-h-10 text-sm",
|
|
4483
4521
|
rows: 1
|
|
4484
4522
|
}
|
|
4485
|
-
), /* @__PURE__ */
|
|
4523
|
+
), /* @__PURE__ */ import_react60.default.createElement("div", { className: "absolute right-1 top-1/2 -translate-y-1/2 flex gap-0.5" }, /* @__PURE__ */ import_react60.default.createElement(
|
|
4486
4524
|
"button",
|
|
4487
4525
|
{
|
|
4488
4526
|
type: "button",
|
|
@@ -4490,8 +4528,8 @@ var Message = import_react59.default.forwardRef(
|
|
|
4490
4528
|
className: "p-1.5 text-obsidian/60 hover:text-obsidian transition-colors",
|
|
4491
4529
|
"aria-label": "Cancel edit"
|
|
4492
4530
|
},
|
|
4493
|
-
/* @__PURE__ */
|
|
4494
|
-
), /* @__PURE__ */
|
|
4531
|
+
/* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.X, { className: "w-4 h-4" })
|
|
4532
|
+
), /* @__PURE__ */ import_react60.default.createElement(
|
|
4495
4533
|
"button",
|
|
4496
4534
|
{
|
|
4497
4535
|
type: "button",
|
|
@@ -4500,8 +4538,8 @@ var Message = import_react59.default.forwardRef(
|
|
|
4500
4538
|
className: "p-1.5 text-obsidian/60 hover:text-obsidian transition-colors disabled:opacity-30",
|
|
4501
4539
|
"aria-label": "Submit edit"
|
|
4502
4540
|
},
|
|
4503
|
-
/* @__PURE__ */
|
|
4504
|
-
)))) : /* @__PURE__ */
|
|
4541
|
+
/* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.Send, { className: "w-4 h-4" })
|
|
4542
|
+
)))) : /* @__PURE__ */ import_react60.default.createElement(
|
|
4505
4543
|
"div",
|
|
4506
4544
|
{
|
|
4507
4545
|
className: cx(
|
|
@@ -4513,7 +4551,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4513
4551
|
role: isJumpInteractive ? "button" : void 0,
|
|
4514
4552
|
"aria-label": isJumpInteractive ? "Jump to this message" : void 0
|
|
4515
4553
|
},
|
|
4516
|
-
typeof content === "string" ? /* @__PURE__ */
|
|
4554
|
+
typeof content === "string" ? /* @__PURE__ */ import_react60.default.createElement(
|
|
4517
4555
|
MarkdownContent,
|
|
4518
4556
|
{
|
|
4519
4557
|
content,
|
|
@@ -4523,17 +4561,17 @@ var Message = import_react59.default.forwardRef(
|
|
|
4523
4561
|
}
|
|
4524
4562
|
) : content
|
|
4525
4563
|
),
|
|
4526
|
-
showActions && !isEditing && /* @__PURE__ */
|
|
4564
|
+
showActions && !isEditing && /* @__PURE__ */ import_react60.default.createElement("div", { className: cx(
|
|
4527
4565
|
"flex items-center gap-0.5 mt-1",
|
|
4528
4566
|
isUser ? "mr-1" : "ml-1"
|
|
4529
|
-
) }, actions.showCopy !== false && /* @__PURE__ */
|
|
4567
|
+
) }, actions.showCopy !== false && /* @__PURE__ */ import_react60.default.createElement(
|
|
4530
4568
|
ActionButton,
|
|
4531
4569
|
{
|
|
4532
4570
|
onClick: handleCopy,
|
|
4533
4571
|
label: copied ? "Copied!" : "Copy message"
|
|
4534
4572
|
},
|
|
4535
|
-
copied ? /* @__PURE__ */
|
|
4536
|
-
), isUser && actions.onEdit && typeof content === "string" && /* @__PURE__ */
|
|
4573
|
+
copied ? /* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.Check, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.Copy, { className: "w-3.5 h-3.5" })
|
|
4574
|
+
), isUser && actions.onEdit && typeof content === "string" && /* @__PURE__ */ import_react60.default.createElement(ActionButton, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.Pencil, { className: "w-3.5 h-3.5" })), !isUser && actions.onRetry && /* @__PURE__ */ import_react60.default.createElement(ActionButton, { onClick: actions.onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.RotateCcw, { className: "w-3.5 h-3.5" })), showBranchNav && /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, /* @__PURE__ */ import_react60.default.createElement("div", { className: "w-px h-4 bg-ash/40 mx-1" }), /* @__PURE__ */ import_react60.default.createElement("div", { className: "flex items-center gap-0.5 text-silver/70" }, /* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.GitBranch, { className: "w-3 h-3 mr-0.5 text-silver/50" }), /* @__PURE__ */ import_react60.default.createElement(
|
|
4537
4575
|
"button",
|
|
4538
4576
|
{
|
|
4539
4577
|
type: "button",
|
|
@@ -4542,8 +4580,8 @@ var Message = import_react59.default.forwardRef(
|
|
|
4542
4580
|
className: BRANCH_BUTTON_CLASSES,
|
|
4543
4581
|
"aria-label": "Previous branch"
|
|
4544
4582
|
},
|
|
4545
|
-
/* @__PURE__ */
|
|
4546
|
-
), /* @__PURE__ */
|
|
4583
|
+
/* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.ChevronLeft, { className: "w-3 h-3" })
|
|
4584
|
+
), /* @__PURE__ */ import_react60.default.createElement("span", { className: "text-xs tabular-nums min-w-6 text-center" }, branchInfo.current, "/", branchInfo.total), /* @__PURE__ */ import_react60.default.createElement(
|
|
4547
4585
|
"button",
|
|
4548
4586
|
{
|
|
4549
4587
|
type: "button",
|
|
@@ -4552,7 +4590,7 @@ var Message = import_react59.default.forwardRef(
|
|
|
4552
4590
|
className: BRANCH_BUTTON_CLASSES,
|
|
4553
4591
|
"aria-label": "Next branch"
|
|
4554
4592
|
},
|
|
4555
|
-
/* @__PURE__ */
|
|
4593
|
+
/* @__PURE__ */ import_react60.default.createElement(import_lucide_react12.ChevronRight, { className: "w-3 h-3" })
|
|
4556
4594
|
))))
|
|
4557
4595
|
);
|
|
4558
4596
|
}
|
|
@@ -4560,15 +4598,15 @@ var Message = import_react59.default.forwardRef(
|
|
|
4560
4598
|
Message.displayName = "Message";
|
|
4561
4599
|
|
|
4562
4600
|
// src/components/StreamingCursor.tsx
|
|
4563
|
-
var
|
|
4564
|
-
var StreamingCursor =
|
|
4601
|
+
var import_react61 = __toESM(require("react"));
|
|
4602
|
+
var StreamingCursor = import_react61.default.forwardRef(
|
|
4565
4603
|
({ className, variant = "line", ...rest }, ref) => {
|
|
4566
4604
|
const variantStyles2 = {
|
|
4567
4605
|
block: "w-2.5 h-cursor translate-y-cursor-offset",
|
|
4568
4606
|
line: "w-0.5 h-cursor translate-y-cursor-offset",
|
|
4569
4607
|
underscore: "w-2.5 h-0.5 self-end mb-0.5"
|
|
4570
4608
|
};
|
|
4571
|
-
return /* @__PURE__ */
|
|
4609
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
4572
4610
|
"span",
|
|
4573
4611
|
{
|
|
4574
4612
|
ref,
|
|
@@ -4586,18 +4624,18 @@ var StreamingCursor = import_react60.default.forwardRef(
|
|
|
4586
4624
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4587
4625
|
|
|
4588
4626
|
// src/components/chat/ChatInterface.tsx
|
|
4589
|
-
var
|
|
4627
|
+
var import_react94 = __toESM(require("react"));
|
|
4590
4628
|
|
|
4591
4629
|
// src/components/chat/ChatView.tsx
|
|
4592
|
-
var
|
|
4630
|
+
var import_react67 = __toESM(require("react"));
|
|
4593
4631
|
|
|
4594
4632
|
// src/components/chat/hooks/useScrollAnchor.ts
|
|
4595
|
-
var
|
|
4633
|
+
var import_react62 = require("react");
|
|
4596
4634
|
function useScrollAnchor(options = {}) {
|
|
4597
4635
|
const { behavior = "smooth", block = "start" } = options;
|
|
4598
|
-
const containerRef = (0,
|
|
4599
|
-
const anchorRef = (0,
|
|
4600
|
-
const scrollToAnchor = (0,
|
|
4636
|
+
const containerRef = (0, import_react62.useRef)(null);
|
|
4637
|
+
const anchorRef = (0, import_react62.useRef)(null);
|
|
4638
|
+
const scrollToAnchor = (0, import_react62.useCallback)(() => {
|
|
4601
4639
|
const el = anchorRef.current;
|
|
4602
4640
|
if (!el) {
|
|
4603
4641
|
return;
|
|
@@ -4608,7 +4646,7 @@ function useScrollAnchor(options = {}) {
|
|
|
4608
4646
|
});
|
|
4609
4647
|
});
|
|
4610
4648
|
}, [behavior, block]);
|
|
4611
|
-
const scrollToBottom = (0,
|
|
4649
|
+
const scrollToBottom = (0, import_react62.useCallback)(() => {
|
|
4612
4650
|
const container = containerRef.current;
|
|
4613
4651
|
if (!container) {
|
|
4614
4652
|
return;
|
|
@@ -4619,7 +4657,7 @@ function useScrollAnchor(options = {}) {
|
|
|
4619
4657
|
container.scrollTop = container.scrollHeight;
|
|
4620
4658
|
}
|
|
4621
4659
|
}, [behavior]);
|
|
4622
|
-
const isScrolledToBottom = (0,
|
|
4660
|
+
const isScrolledToBottom = (0, import_react62.useCallback)(() => {
|
|
4623
4661
|
const container = containerRef.current;
|
|
4624
4662
|
if (!container) {
|
|
4625
4663
|
return true;
|
|
@@ -4638,15 +4676,15 @@ function useScrollAnchor(options = {}) {
|
|
|
4638
4676
|
}
|
|
4639
4677
|
|
|
4640
4678
|
// src/components/chat/hooks/useAdaptiveSpacer.ts
|
|
4641
|
-
var
|
|
4679
|
+
var import_react63 = require("react");
|
|
4642
4680
|
function useAdaptiveSpacer(options = {}) {
|
|
4643
4681
|
const { minHeight = 0, containerRef: externalContainerRef, anchorRef } = options;
|
|
4644
|
-
const internalContainerRef = (0,
|
|
4682
|
+
const internalContainerRef = (0, import_react63.useRef)(null);
|
|
4645
4683
|
const containerRef = externalContainerRef ?? internalContainerRef;
|
|
4646
|
-
const contentRef = (0,
|
|
4647
|
-
const spacerRef = (0,
|
|
4648
|
-
const [spacerHeight, setSpacerHeight] = (0,
|
|
4649
|
-
const recalculate = (0,
|
|
4684
|
+
const contentRef = (0, import_react63.useRef)(null);
|
|
4685
|
+
const spacerRef = (0, import_react63.useRef)(null);
|
|
4686
|
+
const [spacerHeight, setSpacerHeight] = (0, import_react63.useState)(0);
|
|
4687
|
+
const recalculate = (0, import_react63.useCallback)(() => {
|
|
4650
4688
|
const container = containerRef.current;
|
|
4651
4689
|
const content = contentRef.current;
|
|
4652
4690
|
if (!container || !content) {
|
|
@@ -4670,7 +4708,7 @@ function useAdaptiveSpacer(options = {}) {
|
|
|
4670
4708
|
}
|
|
4671
4709
|
setSpacerHeight(newSpacerHeight);
|
|
4672
4710
|
}, [minHeight, anchorRef]);
|
|
4673
|
-
(0,
|
|
4711
|
+
(0, import_react63.useEffect)(() => {
|
|
4674
4712
|
const container = containerRef.current;
|
|
4675
4713
|
const content = contentRef.current;
|
|
4676
4714
|
if (!container || !content) {
|
|
@@ -4705,7 +4743,7 @@ function useAdaptiveSpacer(options = {}) {
|
|
|
4705
4743
|
}
|
|
4706
4744
|
|
|
4707
4745
|
// src/components/chat/ThinkingIndicator.tsx
|
|
4708
|
-
var
|
|
4746
|
+
var import_react64 = __toESM(require("react"));
|
|
4709
4747
|
var THINKING_PHRASES = [
|
|
4710
4748
|
"Consulting the ancient tomes...",
|
|
4711
4749
|
"Parsing the ineffable...",
|
|
@@ -4721,7 +4759,7 @@ var THINKING_PHRASES = [
|
|
|
4721
4759
|
"Consulting my inner monologue...",
|
|
4722
4760
|
"Summoning the muse..."
|
|
4723
4761
|
];
|
|
4724
|
-
var ThinkingIndicator =
|
|
4762
|
+
var ThinkingIndicator = import_react64.default.forwardRef(
|
|
4725
4763
|
({
|
|
4726
4764
|
isVisible = true,
|
|
4727
4765
|
phraseInterval = 2500,
|
|
@@ -4730,12 +4768,12 @@ var ThinkingIndicator = import_react63.default.forwardRef(
|
|
|
4730
4768
|
className,
|
|
4731
4769
|
...rest
|
|
4732
4770
|
}, ref) => {
|
|
4733
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
4771
|
+
const [currentIndex, setCurrentIndex] = (0, import_react64.useState)(
|
|
4734
4772
|
() => Math.floor(Math.random() * phrases.length)
|
|
4735
4773
|
);
|
|
4736
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
4774
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react64.useState)(false);
|
|
4737
4775
|
const isManual = manualLabel !== void 0;
|
|
4738
|
-
(0,
|
|
4776
|
+
(0, import_react64.useEffect)(() => {
|
|
4739
4777
|
if (!isVisible || isManual || phrases.length <= 1) {
|
|
4740
4778
|
return;
|
|
4741
4779
|
}
|
|
@@ -4758,7 +4796,7 @@ var ThinkingIndicator = import_react63.default.forwardRef(
|
|
|
4758
4796
|
if (!isVisible) {
|
|
4759
4797
|
return null;
|
|
4760
4798
|
}
|
|
4761
|
-
return /* @__PURE__ */
|
|
4799
|
+
return /* @__PURE__ */ import_react64.default.createElement(
|
|
4762
4800
|
"div",
|
|
4763
4801
|
{
|
|
4764
4802
|
ref,
|
|
@@ -4772,26 +4810,26 @@ var ThinkingIndicator = import_react63.default.forwardRef(
|
|
|
4772
4810
|
"aria-live": "polite",
|
|
4773
4811
|
...rest
|
|
4774
4812
|
},
|
|
4775
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ import_react64.default.createElement("div", { className: "flex gap-1", "aria-hidden": "true" }, /* @__PURE__ */ import_react64.default.createElement(
|
|
4776
4814
|
"span",
|
|
4777
4815
|
{
|
|
4778
4816
|
className: "w-1.5 h-1.5 bg-gold/60 rounded-full animate-pulse",
|
|
4779
4817
|
style: { animationDelay: "0ms" }
|
|
4780
4818
|
}
|
|
4781
|
-
), /* @__PURE__ */
|
|
4819
|
+
), /* @__PURE__ */ import_react64.default.createElement(
|
|
4782
4820
|
"span",
|
|
4783
4821
|
{
|
|
4784
4822
|
className: "w-1.5 h-1.5 bg-gold/60 rounded-full animate-pulse",
|
|
4785
4823
|
style: { animationDelay: "150ms" }
|
|
4786
4824
|
}
|
|
4787
|
-
), /* @__PURE__ */
|
|
4825
|
+
), /* @__PURE__ */ import_react64.default.createElement(
|
|
4788
4826
|
"span",
|
|
4789
4827
|
{
|
|
4790
4828
|
className: "w-1.5 h-1.5 bg-gold/60 rounded-full animate-pulse",
|
|
4791
4829
|
style: { animationDelay: "300ms" }
|
|
4792
4830
|
}
|
|
4793
4831
|
)),
|
|
4794
|
-
isManual ? /* @__PURE__ */
|
|
4832
|
+
isManual ? /* @__PURE__ */ import_react64.default.createElement("span", { className: "text-sm italic" }, manualLabel) : /* @__PURE__ */ import_react64.default.createElement(
|
|
4795
4833
|
"span",
|
|
4796
4834
|
{
|
|
4797
4835
|
className: cx(
|
|
@@ -4807,7 +4845,7 @@ var ThinkingIndicator = import_react63.default.forwardRef(
|
|
|
4807
4845
|
ThinkingIndicator.displayName = "ThinkingIndicator";
|
|
4808
4846
|
|
|
4809
4847
|
// src/components/chat/Checkpoint.tsx
|
|
4810
|
-
var
|
|
4848
|
+
var import_react65 = __toESM(require("react"));
|
|
4811
4849
|
var import_lucide_react13 = require("lucide-react");
|
|
4812
4850
|
var KIND_ICONS = {
|
|
4813
4851
|
task: import_lucide_react13.GitBranch,
|
|
@@ -4823,7 +4861,7 @@ var KIND_ARIA_LABELS = {
|
|
|
4823
4861
|
init: "Project head checkpoint",
|
|
4824
4862
|
ingest: "Upload batch checkpoint"
|
|
4825
4863
|
};
|
|
4826
|
-
var Checkpoint =
|
|
4864
|
+
var Checkpoint = import_react65.default.forwardRef(
|
|
4827
4865
|
function Checkpoint2({ name, executionKind, status = "completed", isActive, muted, branchInfo, onJumpHere }, ref) {
|
|
4828
4866
|
const KindIcon = KIND_ICONS[executionKind];
|
|
4829
4867
|
const isFailed = status === "failed";
|
|
@@ -4834,7 +4872,7 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4834
4872
|
"transition-colors text-xs",
|
|
4835
4873
|
isActive ? "text-silver font-medium" : isInteractive ? "text-silver/70 hover:text-white underline decoration-silver/30 underline-offset-4 decoration-dotted hover:decoration-silver/70" : "text-silver/50"
|
|
4836
4874
|
);
|
|
4837
|
-
return /* @__PURE__ */
|
|
4875
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
4838
4876
|
"div",
|
|
4839
4877
|
{
|
|
4840
4878
|
ref,
|
|
@@ -4845,8 +4883,8 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4845
4883
|
muted && "opacity-60"
|
|
4846
4884
|
)
|
|
4847
4885
|
},
|
|
4848
|
-
/* @__PURE__ */
|
|
4849
|
-
/* @__PURE__ */
|
|
4886
|
+
/* @__PURE__ */ import_react65.default.createElement(KindIcon, { className: cx("w-3.5 h-3.5 shrink-0", iconColor), "aria-hidden": "true" }),
|
|
4887
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
4850
4888
|
"button",
|
|
4851
4889
|
{
|
|
4852
4890
|
type: "button",
|
|
@@ -4859,11 +4897,11 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4859
4897
|
),
|
|
4860
4898
|
"aria-label": isInteractive ? `Jump to checkpoint ${name}` : name
|
|
4861
4899
|
},
|
|
4862
|
-
/* @__PURE__ */
|
|
4863
|
-
isFailed && /* @__PURE__ */
|
|
4864
|
-
isCancelled && /* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ import_react65.default.createElement("span", { className: "truncate" }, name),
|
|
4901
|
+
isFailed && /* @__PURE__ */ import_react65.default.createElement("span", { className: "ml-1.5 text-error-muted" }, "\xB7 failed"),
|
|
4902
|
+
isCancelled && /* @__PURE__ */ import_react65.default.createElement("span", { className: "ml-1.5 text-silver/40" }, "\xB7 cancelled")
|
|
4865
4903
|
),
|
|
4866
|
-
isInteractive && /* @__PURE__ */
|
|
4904
|
+
isInteractive && /* @__PURE__ */ import_react65.default.createElement(
|
|
4867
4905
|
"span",
|
|
4868
4906
|
{
|
|
4869
4907
|
className: cx(
|
|
@@ -4873,17 +4911,17 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4873
4911
|
),
|
|
4874
4912
|
"aria-hidden": "true"
|
|
4875
4913
|
},
|
|
4876
|
-
/* @__PURE__ */
|
|
4914
|
+
/* @__PURE__ */ import_react65.default.createElement(import_lucide_react13.ArrowLeft, { className: "w-3 h-3" }),
|
|
4877
4915
|
"Jump here"
|
|
4878
4916
|
),
|
|
4879
|
-
branchInfo && branchInfo.total > 1 && /* @__PURE__ */
|
|
4917
|
+
branchInfo && branchInfo.total > 1 && /* @__PURE__ */ import_react65.default.createElement(
|
|
4880
4918
|
"div",
|
|
4881
4919
|
{
|
|
4882
4920
|
className: "ml-auto inline-flex items-center gap-0.5 text-silver/70 text-xs",
|
|
4883
4921
|
role: "navigation",
|
|
4884
4922
|
"aria-label": "Switch sibling checkpoint"
|
|
4885
4923
|
},
|
|
4886
|
-
/* @__PURE__ */
|
|
4924
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
4887
4925
|
"button",
|
|
4888
4926
|
{
|
|
4889
4927
|
type: "button",
|
|
@@ -4895,10 +4933,10 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4895
4933
|
),
|
|
4896
4934
|
"aria-label": "Previous sibling checkpoint"
|
|
4897
4935
|
},
|
|
4898
|
-
/* @__PURE__ */
|
|
4936
|
+
/* @__PURE__ */ import_react65.default.createElement(import_lucide_react13.ChevronLeft, { className: "w-3 h-3" })
|
|
4899
4937
|
),
|
|
4900
|
-
/* @__PURE__ */
|
|
4901
|
-
/* @__PURE__ */
|
|
4938
|
+
/* @__PURE__ */ import_react65.default.createElement("span", { className: "tabular-nums min-w-6 text-center" }, branchInfo.current, "/", branchInfo.total),
|
|
4939
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
4902
4940
|
"button",
|
|
4903
4941
|
{
|
|
4904
4942
|
type: "button",
|
|
@@ -4910,7 +4948,7 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4910
4948
|
),
|
|
4911
4949
|
"aria-label": "Next sibling checkpoint"
|
|
4912
4950
|
},
|
|
4913
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ import_react65.default.createElement(import_lucide_react13.ChevronRight, { className: "w-3 h-3" })
|
|
4914
4952
|
)
|
|
4915
4953
|
)
|
|
4916
4954
|
);
|
|
@@ -4919,7 +4957,7 @@ var Checkpoint = import_react64.default.forwardRef(
|
|
|
4919
4957
|
Checkpoint.displayName = "Checkpoint";
|
|
4920
4958
|
|
|
4921
4959
|
// src/components/chat/GreyedDivider.tsx
|
|
4922
|
-
var
|
|
4960
|
+
var import_react66 = __toESM(require("react"));
|
|
4923
4961
|
var import_lucide_react14 = require("lucide-react");
|
|
4924
4962
|
function pluralize(n, singular, plural) {
|
|
4925
4963
|
return `${n} ${n === 1 ? singular : plural}`;
|
|
@@ -4934,12 +4972,12 @@ function summarize(messageCount, checkpointCount) {
|
|
|
4934
4972
|
}
|
|
4935
4973
|
return parts.length > 0 ? parts.join(", ") : "no items";
|
|
4936
4974
|
}
|
|
4937
|
-
var GreyedDivider =
|
|
4975
|
+
var GreyedDivider = import_react66.default.forwardRef(
|
|
4938
4976
|
function GreyedDivider2({ messageCount, checkpointCount, onJumpToLatest }, ref) {
|
|
4939
4977
|
if (messageCount === 0 && checkpointCount === 0) {
|
|
4940
4978
|
return null;
|
|
4941
4979
|
}
|
|
4942
|
-
return /* @__PURE__ */
|
|
4980
|
+
return /* @__PURE__ */ import_react66.default.createElement(
|
|
4943
4981
|
"div",
|
|
4944
4982
|
{
|
|
4945
4983
|
ref,
|
|
@@ -4947,10 +4985,10 @@ var GreyedDivider = import_react65.default.forwardRef(
|
|
|
4947
4985
|
"aria-label": "Start of rewound timeline",
|
|
4948
4986
|
className: "flex items-center gap-3 py-2 text-xs text-silver/50 select-none"
|
|
4949
4987
|
},
|
|
4950
|
-
/* @__PURE__ */
|
|
4951
|
-
/* @__PURE__ */
|
|
4952
|
-
/* @__PURE__ */
|
|
4953
|
-
onJumpToLatest && /* @__PURE__ */
|
|
4988
|
+
/* @__PURE__ */ import_react66.default.createElement("div", { className: "flex-1 h-px bg-ash/40", "aria-hidden": "true" }),
|
|
4989
|
+
/* @__PURE__ */ import_react66.default.createElement("span", { className: "inline-flex items-center gap-1.5 whitespace-nowrap" }, /* @__PURE__ */ import_react66.default.createElement(import_lucide_react14.ArrowDown, { className: "w-3 h-3", "aria-hidden": "true" }), "Later in this conversation \xB7 ", summarize(messageCount, checkpointCount)),
|
|
4990
|
+
/* @__PURE__ */ import_react66.default.createElement("div", { className: "flex-1 h-px bg-ash/40", "aria-hidden": "true" }),
|
|
4991
|
+
onJumpToLatest && /* @__PURE__ */ import_react66.default.createElement(
|
|
4954
4992
|
"button",
|
|
4955
4993
|
{
|
|
4956
4994
|
type: "button",
|
|
@@ -4969,7 +5007,7 @@ var GreyedDivider = import_react65.default.forwardRef(
|
|
|
4969
5007
|
GreyedDivider.displayName = "GreyedDivider";
|
|
4970
5008
|
|
|
4971
5009
|
// src/components/chat/ChatView.tsx
|
|
4972
|
-
var ChatView =
|
|
5010
|
+
var ChatView = import_react67.default.forwardRef(
|
|
4973
5011
|
function ChatView2({
|
|
4974
5012
|
items,
|
|
4975
5013
|
latestUserMessageIndex,
|
|
@@ -4993,7 +5031,7 @@ var ChatView = import_react66.default.forwardRef(
|
|
|
4993
5031
|
}
|
|
4994
5032
|
return found;
|
|
4995
5033
|
}, -1);
|
|
4996
|
-
(0,
|
|
5034
|
+
(0, import_react67.useEffect)(() => {
|
|
4997
5035
|
if (latestUserMessageIndex !== void 0 && latestUserMessageIndex >= 0) {
|
|
4998
5036
|
scrollToAnchor();
|
|
4999
5037
|
}
|
|
@@ -5002,7 +5040,7 @@ var ChatView = import_react66.default.forwardRef(
|
|
|
5002
5040
|
return found ?? (item.kind === "message" ? item : null);
|
|
5003
5041
|
}, null);
|
|
5004
5042
|
const showThinking = isThinking && lastMessage?.kind === "message" && lastMessage.variant === "user";
|
|
5005
|
-
return /* @__PURE__ */
|
|
5043
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5006
5044
|
"div",
|
|
5007
5045
|
{
|
|
5008
5046
|
ref: composeRefs(containerRef, ref),
|
|
@@ -5014,17 +5052,17 @@ var ChatView = import_react66.default.forwardRef(
|
|
|
5014
5052
|
),
|
|
5015
5053
|
...rest
|
|
5016
5054
|
},
|
|
5017
|
-
/* @__PURE__ */
|
|
5055
|
+
/* @__PURE__ */ import_react67.default.createElement("div", { ref: contentRef, className: "relative flex flex-col gap-3" }, items.map((item, index) => {
|
|
5018
5056
|
const isAnchor = index === latestUserIdx;
|
|
5019
5057
|
const wrapperRef = isAnchor ? anchorRef : void 0;
|
|
5020
5058
|
const wrapperClass = isAnchor ? "scroll-mt-4" : void 0;
|
|
5021
5059
|
if (item.kind === "divider") {
|
|
5022
5060
|
const { kind: _k2, id: id2, ...dividerProps } = item;
|
|
5023
|
-
return /* @__PURE__ */
|
|
5061
|
+
return /* @__PURE__ */ import_react67.default.createElement("div", { key: id2 }, /* @__PURE__ */ import_react67.default.createElement(GreyedDivider, { ...dividerProps }));
|
|
5024
5062
|
}
|
|
5025
5063
|
if (item.kind === "checkpoint") {
|
|
5026
5064
|
const { kind: _k2, id: id2, ...checkpointProps } = item;
|
|
5027
|
-
return /* @__PURE__ */
|
|
5065
|
+
return /* @__PURE__ */ import_react67.default.createElement("div", { key: id2, ref: wrapperRef, className: wrapperClass }, /* @__PURE__ */ import_react67.default.createElement(Checkpoint, { ...checkpointProps }));
|
|
5028
5066
|
}
|
|
5029
5067
|
const {
|
|
5030
5068
|
kind: _k,
|
|
@@ -5038,14 +5076,14 @@ var ChatView = import_react66.default.forwardRef(
|
|
|
5038
5076
|
...messageProps
|
|
5039
5077
|
} = item;
|
|
5040
5078
|
const isMessageStreaming = !!nodeIsStreaming;
|
|
5041
|
-
return /* @__PURE__ */
|
|
5079
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5042
5080
|
"div",
|
|
5043
5081
|
{
|
|
5044
5082
|
key: id,
|
|
5045
5083
|
ref: wrapperRef,
|
|
5046
5084
|
className: cx(wrapperClass, muted && "opacity-60")
|
|
5047
5085
|
},
|
|
5048
|
-
/* @__PURE__ */
|
|
5086
|
+
/* @__PURE__ */ import_react67.default.createElement(
|
|
5049
5087
|
Message,
|
|
5050
5088
|
{
|
|
5051
5089
|
variant,
|
|
@@ -5058,8 +5096,8 @@ var ChatView = import_react66.default.forwardRef(
|
|
|
5058
5096
|
}
|
|
5059
5097
|
)
|
|
5060
5098
|
);
|
|
5061
|
-
}), showThinking && /* @__PURE__ */
|
|
5062
|
-
/* @__PURE__ */
|
|
5099
|
+
}), showThinking && /* @__PURE__ */ import_react67.default.createElement(ThinkingIndicator, { isVisible: true, manualLabel: thinkingLabel })),
|
|
5100
|
+
/* @__PURE__ */ import_react67.default.createElement(
|
|
5063
5101
|
"div",
|
|
5064
5102
|
{
|
|
5065
5103
|
ref: spacerRef,
|
|
@@ -5074,7 +5112,7 @@ var ChatView = import_react66.default.forwardRef(
|
|
|
5074
5112
|
ChatView.displayName = "ChatView";
|
|
5075
5113
|
|
|
5076
5114
|
// src/components/chat/ChatInput.tsx
|
|
5077
|
-
var
|
|
5115
|
+
var import_react68 = __toESM(require("react"));
|
|
5078
5116
|
var import_lucide_react15 = require("lucide-react");
|
|
5079
5117
|
|
|
5080
5118
|
// src/components/chat/types.ts
|
|
@@ -5100,7 +5138,17 @@ function generateId() {
|
|
|
5100
5138
|
}
|
|
5101
5139
|
|
|
5102
5140
|
// src/components/chat/ChatInput.tsx
|
|
5103
|
-
var
|
|
5141
|
+
var noticeContainerClass = {
|
|
5142
|
+
info: "bg-charcoal border border-ash/40 text-silver",
|
|
5143
|
+
warning: "bg-gold/5 border border-gold/20 text-gold/80",
|
|
5144
|
+
error: "bg-error/10 border border-error/30 text-error"
|
|
5145
|
+
};
|
|
5146
|
+
var noticeDismissClass = {
|
|
5147
|
+
info: "text-silver",
|
|
5148
|
+
warning: "text-gold",
|
|
5149
|
+
error: "text-error"
|
|
5150
|
+
};
|
|
5151
|
+
var ChatInput = import_react68.default.forwardRef(
|
|
5104
5152
|
({
|
|
5105
5153
|
position = "bottom",
|
|
5106
5154
|
placeholder = "Send a message...",
|
|
@@ -5124,17 +5172,17 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5124
5172
|
className,
|
|
5125
5173
|
...rest
|
|
5126
5174
|
}, ref) => {
|
|
5127
|
-
const [value, setValue] = (0,
|
|
5128
|
-
const [localAttachments, setLocalAttachments] = (0,
|
|
5129
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
5130
|
-
const textareaRef = (0,
|
|
5131
|
-
const fileInputRef = (0,
|
|
5132
|
-
const mergedTextareaRef = (0,
|
|
5175
|
+
const [value, setValue] = (0, import_react68.useState)(initialInputValue);
|
|
5176
|
+
const [localAttachments, setLocalAttachments] = (0, import_react68.useState)([]);
|
|
5177
|
+
const [isDragOver, setIsDragOver] = (0, import_react68.useState)(false);
|
|
5178
|
+
const textareaRef = (0, import_react68.useRef)(null);
|
|
5179
|
+
const fileInputRef = (0, import_react68.useRef)(null);
|
|
5180
|
+
const mergedTextareaRef = (0, import_react68.useMemo)(
|
|
5133
5181
|
() => composeRefs(textareaRef, externalTextareaRef),
|
|
5134
5182
|
[externalTextareaRef]
|
|
5135
5183
|
);
|
|
5136
5184
|
const attachments = controlledAttachments ?? localAttachments;
|
|
5137
|
-
const setAttachments = (0,
|
|
5185
|
+
const setAttachments = (0, import_react68.useCallback)(
|
|
5138
5186
|
(newAttachments) => {
|
|
5139
5187
|
if (onAttachmentsChange) {
|
|
5140
5188
|
if (typeof newAttachments === "function") {
|
|
@@ -5148,7 +5196,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5148
5196
|
},
|
|
5149
5197
|
[attachments, onAttachmentsChange]
|
|
5150
5198
|
);
|
|
5151
|
-
const handleSubmit = (0,
|
|
5199
|
+
const handleSubmit = (0, import_react68.useCallback)(() => {
|
|
5152
5200
|
const trimmed = value.trim();
|
|
5153
5201
|
if (!trimmed || disabled || isStreaming) {
|
|
5154
5202
|
return;
|
|
@@ -5160,7 +5208,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5160
5208
|
textareaRef.current.style.height = "auto";
|
|
5161
5209
|
}
|
|
5162
5210
|
}, [value, disabled, isStreaming, onSubmit, attachments, setAttachments]);
|
|
5163
|
-
const handleKeyDown = (0,
|
|
5211
|
+
const handleKeyDown = (0, import_react68.useCallback)(
|
|
5164
5212
|
(e) => {
|
|
5165
5213
|
onTextareaKeyDown?.(e);
|
|
5166
5214
|
if (e.defaultPrevented) {
|
|
@@ -5173,19 +5221,19 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5173
5221
|
},
|
|
5174
5222
|
[handleSubmit, onTextareaKeyDown]
|
|
5175
5223
|
);
|
|
5176
|
-
const handleChange = (0,
|
|
5224
|
+
const handleChange = (0, import_react68.useCallback)((e) => {
|
|
5177
5225
|
setValue(e.target.value);
|
|
5178
5226
|
onInputChange?.(e.target.value);
|
|
5179
5227
|
const textarea = e.target;
|
|
5180
5228
|
textarea.style.height = "auto";
|
|
5181
5229
|
textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;
|
|
5182
5230
|
}, [onInputChange]);
|
|
5183
|
-
(0,
|
|
5231
|
+
(0, import_react68.useEffect)(() => {
|
|
5184
5232
|
if (autoFocus && !disabled && !isStreaming && textareaRef.current) {
|
|
5185
5233
|
textareaRef.current.focus();
|
|
5186
5234
|
}
|
|
5187
5235
|
}, [disabled, isStreaming, autoFocus]);
|
|
5188
|
-
const addFiles = (0,
|
|
5236
|
+
const addFiles = (0, import_react68.useCallback)(
|
|
5189
5237
|
(files) => {
|
|
5190
5238
|
const newAttachments = Array.from(files).map((file) => ({
|
|
5191
5239
|
id: generateId(),
|
|
@@ -5197,7 +5245,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5197
5245
|
},
|
|
5198
5246
|
[setAttachments]
|
|
5199
5247
|
);
|
|
5200
|
-
const handleFileSelect = (0,
|
|
5248
|
+
const handleFileSelect = (0, import_react68.useCallback)(
|
|
5201
5249
|
(e) => {
|
|
5202
5250
|
const files = e.target.files;
|
|
5203
5251
|
if (files && files.length > 0) {
|
|
@@ -5207,7 +5255,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5207
5255
|
},
|
|
5208
5256
|
[addFiles]
|
|
5209
5257
|
);
|
|
5210
|
-
const handleRemoveAttachment = (0,
|
|
5258
|
+
const handleRemoveAttachment = (0, import_react68.useCallback)(
|
|
5211
5259
|
(id) => {
|
|
5212
5260
|
const attachment = attachments.find((a) => a.id === id);
|
|
5213
5261
|
if (attachment && onAttachmentRemove) {
|
|
@@ -5223,23 +5271,23 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5223
5271
|
},
|
|
5224
5272
|
[attachments, onAttachmentRemove, setAttachments]
|
|
5225
5273
|
);
|
|
5226
|
-
const handleDragEnter = (0,
|
|
5274
|
+
const handleDragEnter = (0, import_react68.useCallback)((e) => {
|
|
5227
5275
|
e.preventDefault();
|
|
5228
5276
|
e.stopPropagation();
|
|
5229
5277
|
setIsDragOver(true);
|
|
5230
5278
|
}, []);
|
|
5231
|
-
const handleDragLeave = (0,
|
|
5279
|
+
const handleDragLeave = (0, import_react68.useCallback)((e) => {
|
|
5232
5280
|
e.preventDefault();
|
|
5233
5281
|
e.stopPropagation();
|
|
5234
5282
|
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
5235
5283
|
setIsDragOver(false);
|
|
5236
5284
|
}
|
|
5237
5285
|
}, []);
|
|
5238
|
-
const handleDragOver = (0,
|
|
5286
|
+
const handleDragOver = (0, import_react68.useCallback)((e) => {
|
|
5239
5287
|
e.preventDefault();
|
|
5240
5288
|
e.stopPropagation();
|
|
5241
5289
|
}, []);
|
|
5242
|
-
const handleDrop = (0,
|
|
5290
|
+
const handleDrop = (0, import_react68.useCallback)(
|
|
5243
5291
|
(e) => {
|
|
5244
5292
|
e.preventDefault();
|
|
5245
5293
|
e.stopPropagation();
|
|
@@ -5255,7 +5303,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5255
5303
|
const hasAttachments = attachments.length > 0;
|
|
5256
5304
|
const isUploadIncomplete = attachments.some((a) => a.status === "pending" || a.status === "uploading" || a.status === "upload_failed");
|
|
5257
5305
|
const canSubmit = value.trim() && !disabled && !isStreaming && !isUploadIncomplete;
|
|
5258
|
-
return /* @__PURE__ */
|
|
5306
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5259
5307
|
"div",
|
|
5260
5308
|
{
|
|
5261
5309
|
ref,
|
|
@@ -5267,12 +5315,12 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5267
5315
|
),
|
|
5268
5316
|
...rest
|
|
5269
5317
|
},
|
|
5270
|
-
isCentered && helperText && /* @__PURE__ */
|
|
5271
|
-
notice && /* @__PURE__ */
|
|
5318
|
+
isCentered && helperText && /* @__PURE__ */ import_react68.default.createElement("p", { className: "text-silver text-sm mb-4 text-center" }, helperText),
|
|
5319
|
+
notice && /* @__PURE__ */ import_react68.default.createElement("div", { className: cx(
|
|
5272
5320
|
"w-full flex items-start gap-2 px-3 py-2 mb-1 text-xs",
|
|
5273
5321
|
isCentered && "max-w-lg",
|
|
5274
|
-
notice.variant
|
|
5275
|
-
) }, /* @__PURE__ */
|
|
5322
|
+
noticeContainerClass[notice.variant]
|
|
5323
|
+
) }, /* @__PURE__ */ import_react68.default.createElement("span", { className: "flex-1" }, notice.content), (notice.dismissible ?? notice.variant === "warning") && notice.onDismiss && /* @__PURE__ */ import_react68.default.createElement(
|
|
5276
5324
|
"button",
|
|
5277
5325
|
{
|
|
5278
5326
|
type: "button",
|
|
@@ -5280,12 +5328,12 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5280
5328
|
"aria-label": "Dismiss",
|
|
5281
5329
|
className: cx(
|
|
5282
5330
|
"shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
5283
|
-
notice.variant
|
|
5331
|
+
noticeDismissClass[notice.variant]
|
|
5284
5332
|
)
|
|
5285
5333
|
},
|
|
5286
|
-
/* @__PURE__ */
|
|
5334
|
+
/* @__PURE__ */ import_react68.default.createElement(import_lucide_react15.X, { className: "w-3 h-3" })
|
|
5287
5335
|
)),
|
|
5288
|
-
/* @__PURE__ */
|
|
5336
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5289
5337
|
"div",
|
|
5290
5338
|
{
|
|
5291
5339
|
className: cx(
|
|
@@ -5300,7 +5348,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5300
5348
|
onDragOver: showAttachmentButton ? handleDragOver : void 0,
|
|
5301
5349
|
onDrop: showAttachmentButton ? handleDrop : void 0
|
|
5302
5350
|
},
|
|
5303
|
-
hasAttachments && /* @__PURE__ */
|
|
5351
|
+
hasAttachments && /* @__PURE__ */ import_react68.default.createElement("div", { className: "px-3 pt-3 pb-1" }, /* @__PURE__ */ import_react68.default.createElement(
|
|
5304
5352
|
AttachmentPreview,
|
|
5305
5353
|
{
|
|
5306
5354
|
attachments,
|
|
@@ -5308,14 +5356,14 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5308
5356
|
removable: !isStreaming
|
|
5309
5357
|
}
|
|
5310
5358
|
)),
|
|
5311
|
-
isDragOver && /* @__PURE__ */
|
|
5359
|
+
isDragOver && /* @__PURE__ */ import_react68.default.createElement(
|
|
5312
5360
|
"div",
|
|
5313
5361
|
{
|
|
5314
5362
|
className: "absolute inset-0 bg-gold/10 flex items-center justify-center z-10 pointer-events-none"
|
|
5315
5363
|
},
|
|
5316
|
-
/* @__PURE__ */
|
|
5364
|
+
/* @__PURE__ */ import_react68.default.createElement("span", { className: "text-gold text-sm font-medium" }, "Drop files here")
|
|
5317
5365
|
),
|
|
5318
|
-
/* @__PURE__ */
|
|
5366
|
+
/* @__PURE__ */ import_react68.default.createElement("div", { className: "flex items-end" }, showAttachmentButton && /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement(
|
|
5319
5367
|
"button",
|
|
5320
5368
|
{
|
|
5321
5369
|
type: "button",
|
|
@@ -5327,8 +5375,8 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5327
5375
|
),
|
|
5328
5376
|
"aria-label": "Attach file"
|
|
5329
5377
|
},
|
|
5330
|
-
/* @__PURE__ */
|
|
5331
|
-
), /* @__PURE__ */
|
|
5378
|
+
/* @__PURE__ */ import_react68.default.createElement(import_lucide_react15.Paperclip, { className: "w-5 h-5" })
|
|
5379
|
+
), /* @__PURE__ */ import_react68.default.createElement(
|
|
5332
5380
|
"input",
|
|
5333
5381
|
{
|
|
5334
5382
|
ref: fileInputRef,
|
|
@@ -5339,7 +5387,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5339
5387
|
className: "hidden",
|
|
5340
5388
|
"aria-hidden": "true"
|
|
5341
5389
|
}
|
|
5342
|
-
)), /* @__PURE__ */
|
|
5390
|
+
)), /* @__PURE__ */ import_react68.default.createElement(
|
|
5343
5391
|
"textarea",
|
|
5344
5392
|
{
|
|
5345
5393
|
ref: mergedTextareaRef,
|
|
@@ -5357,7 +5405,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5357
5405
|
),
|
|
5358
5406
|
style: { maxHeight: 200 }
|
|
5359
5407
|
}
|
|
5360
|
-
), isStreaming ? /* @__PURE__ */
|
|
5408
|
+
), isStreaming ? /* @__PURE__ */ import_react68.default.createElement(
|
|
5361
5409
|
"button",
|
|
5362
5410
|
{
|
|
5363
5411
|
type: "button",
|
|
@@ -5368,8 +5416,8 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5368
5416
|
),
|
|
5369
5417
|
"aria-label": "Stop generation"
|
|
5370
5418
|
},
|
|
5371
|
-
/* @__PURE__ */
|
|
5372
|
-
) : /* @__PURE__ */
|
|
5419
|
+
/* @__PURE__ */ import_react68.default.createElement(import_lucide_react15.Square, { className: "w-5 h-5 fill-current" })
|
|
5420
|
+
) : /* @__PURE__ */ import_react68.default.createElement(
|
|
5373
5421
|
"button",
|
|
5374
5422
|
{
|
|
5375
5423
|
type: "button",
|
|
@@ -5382,7 +5430,7 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5382
5430
|
),
|
|
5383
5431
|
"aria-label": "Send message"
|
|
5384
5432
|
},
|
|
5385
|
-
/* @__PURE__ */
|
|
5433
|
+
/* @__PURE__ */ import_react68.default.createElement(import_lucide_react15.Send, { className: "w-5 h-5" })
|
|
5386
5434
|
))
|
|
5387
5435
|
)
|
|
5388
5436
|
);
|
|
@@ -5391,14 +5439,14 @@ var ChatInput = import_react67.default.forwardRef(
|
|
|
5391
5439
|
ChatInput.displayName = "ChatInput";
|
|
5392
5440
|
|
|
5393
5441
|
// src/components/chat/ArtifactsPanel.tsx
|
|
5394
|
-
var
|
|
5442
|
+
var import_react89 = __toESM(require("react"));
|
|
5395
5443
|
var import_lucide_react18 = require("lucide-react");
|
|
5396
5444
|
|
|
5397
5445
|
// src/components/ArtifactCard.tsx
|
|
5398
|
-
var
|
|
5446
|
+
var import_react76 = __toESM(require("react"));
|
|
5399
5447
|
|
|
5400
5448
|
// src/components/ImageCard.tsx
|
|
5401
|
-
var
|
|
5449
|
+
var import_react69 = __toESM(require("react"));
|
|
5402
5450
|
var ASPECT_RATIO_PRESETS = {
|
|
5403
5451
|
landscape: "3 / 2",
|
|
5404
5452
|
portrait: "2 / 3",
|
|
@@ -5410,7 +5458,7 @@ function resolveAspectRatio(ratio) {
|
|
|
5410
5458
|
}
|
|
5411
5459
|
return ratio.replace("/", " / ");
|
|
5412
5460
|
}
|
|
5413
|
-
var ImageCard =
|
|
5461
|
+
var ImageCard = import_react69.default.forwardRef(
|
|
5414
5462
|
({
|
|
5415
5463
|
src,
|
|
5416
5464
|
alt = "",
|
|
@@ -5427,7 +5475,7 @@ var ImageCard = import_react68.default.forwardRef(
|
|
|
5427
5475
|
loading,
|
|
5428
5476
|
...props
|
|
5429
5477
|
}, ref) => {
|
|
5430
|
-
return /* @__PURE__ */
|
|
5478
|
+
return /* @__PURE__ */ import_react69.default.createElement(
|
|
5431
5479
|
Card,
|
|
5432
5480
|
{
|
|
5433
5481
|
ref,
|
|
@@ -5435,13 +5483,13 @@ var ImageCard = import_react68.default.forwardRef(
|
|
|
5435
5483
|
loading,
|
|
5436
5484
|
...props
|
|
5437
5485
|
},
|
|
5438
|
-
/* @__PURE__ */
|
|
5486
|
+
/* @__PURE__ */ import_react69.default.createElement(
|
|
5439
5487
|
Card.Media,
|
|
5440
5488
|
{
|
|
5441
5489
|
className: mediaClassName,
|
|
5442
5490
|
style: { aspectRatio: resolveAspectRatio(aspectRatio) }
|
|
5443
5491
|
},
|
|
5444
|
-
/* @__PURE__ */
|
|
5492
|
+
/* @__PURE__ */ import_react69.default.createElement(import_react69.default.Fragment, null, src && /* @__PURE__ */ import_react69.default.createElement(
|
|
5445
5493
|
"img",
|
|
5446
5494
|
{
|
|
5447
5495
|
src,
|
|
@@ -5451,7 +5499,7 @@ var ImageCard = import_react68.default.forwardRef(
|
|
|
5451
5499
|
objectFit === "cover" ? "object-cover" : "object-contain"
|
|
5452
5500
|
)
|
|
5453
5501
|
}
|
|
5454
|
-
), overlay && /* @__PURE__ */
|
|
5502
|
+
), overlay && /* @__PURE__ */ import_react69.default.createElement(
|
|
5455
5503
|
"div",
|
|
5456
5504
|
{
|
|
5457
5505
|
className: "absolute inset-0 bg-obsidian/80 opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex items-center justify-center"
|
|
@@ -5459,7 +5507,7 @@ var ImageCard = import_react68.default.forwardRef(
|
|
|
5459
5507
|
overlay
|
|
5460
5508
|
))
|
|
5461
5509
|
),
|
|
5462
|
-
/* @__PURE__ */
|
|
5510
|
+
/* @__PURE__ */ import_react69.default.createElement(
|
|
5463
5511
|
Card.Header,
|
|
5464
5512
|
{
|
|
5465
5513
|
title,
|
|
@@ -5468,14 +5516,14 @@ var ImageCard = import_react68.default.forwardRef(
|
|
|
5468
5516
|
className: contentClassName
|
|
5469
5517
|
}
|
|
5470
5518
|
),
|
|
5471
|
-
children && /* @__PURE__ */
|
|
5519
|
+
children && /* @__PURE__ */ import_react69.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5472
5520
|
);
|
|
5473
5521
|
}
|
|
5474
5522
|
);
|
|
5475
5523
|
ImageCard.displayName = "ImageCard";
|
|
5476
5524
|
|
|
5477
5525
|
// src/components/VideoCard.tsx
|
|
5478
|
-
var
|
|
5526
|
+
var import_react70 = __toESM(require("react"));
|
|
5479
5527
|
var import_react_player = __toESM(require("react-player"));
|
|
5480
5528
|
var ASPECT_RATIO_PRESETS2 = {
|
|
5481
5529
|
video: "16 / 9",
|
|
@@ -5488,7 +5536,7 @@ function resolveAspectRatio2(ratio) {
|
|
|
5488
5536
|
}
|
|
5489
5537
|
return ratio.replace("/", " / ");
|
|
5490
5538
|
}
|
|
5491
|
-
var VideoCard =
|
|
5539
|
+
var VideoCard = import_react70.default.forwardRef(
|
|
5492
5540
|
({
|
|
5493
5541
|
src,
|
|
5494
5542
|
title,
|
|
@@ -5509,7 +5557,7 @@ var VideoCard = import_react69.default.forwardRef(
|
|
|
5509
5557
|
loading,
|
|
5510
5558
|
...props
|
|
5511
5559
|
}, ref) => {
|
|
5512
|
-
return /* @__PURE__ */
|
|
5560
|
+
return /* @__PURE__ */ import_react70.default.createElement(
|
|
5513
5561
|
Card,
|
|
5514
5562
|
{
|
|
5515
5563
|
ref,
|
|
@@ -5517,13 +5565,13 @@ var VideoCard = import_react69.default.forwardRef(
|
|
|
5517
5565
|
loading,
|
|
5518
5566
|
...props
|
|
5519
5567
|
},
|
|
5520
|
-
/* @__PURE__ */
|
|
5568
|
+
/* @__PURE__ */ import_react70.default.createElement(
|
|
5521
5569
|
Card.Media,
|
|
5522
5570
|
{
|
|
5523
5571
|
className: mediaClassName,
|
|
5524
5572
|
style: { aspectRatio: resolveAspectRatio2(aspectRatio) }
|
|
5525
5573
|
},
|
|
5526
|
-
src && /* @__PURE__ */
|
|
5574
|
+
src && /* @__PURE__ */ import_react70.default.createElement(
|
|
5527
5575
|
import_react_player.default,
|
|
5528
5576
|
{
|
|
5529
5577
|
src,
|
|
@@ -5540,7 +5588,7 @@ var VideoCard = import_react69.default.forwardRef(
|
|
|
5540
5588
|
}
|
|
5541
5589
|
)
|
|
5542
5590
|
),
|
|
5543
|
-
/* @__PURE__ */
|
|
5591
|
+
/* @__PURE__ */ import_react70.default.createElement(
|
|
5544
5592
|
Card.Header,
|
|
5545
5593
|
{
|
|
5546
5594
|
title,
|
|
@@ -5549,17 +5597,17 @@ var VideoCard = import_react69.default.forwardRef(
|
|
|
5549
5597
|
className: contentClassName
|
|
5550
5598
|
}
|
|
5551
5599
|
),
|
|
5552
|
-
children && /* @__PURE__ */
|
|
5600
|
+
children && /* @__PURE__ */ import_react70.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5553
5601
|
);
|
|
5554
5602
|
}
|
|
5555
5603
|
);
|
|
5556
5604
|
VideoCard.displayName = "VideoCard";
|
|
5557
5605
|
|
|
5558
5606
|
// src/components/AudioCard.tsx
|
|
5559
|
-
var
|
|
5607
|
+
var import_react71 = __toESM(require("react"));
|
|
5560
5608
|
var import_react_player2 = __toESM(require("react-player"));
|
|
5561
5609
|
var import_lucide_react16 = require("lucide-react");
|
|
5562
|
-
var AudioCard =
|
|
5610
|
+
var AudioCard = import_react71.default.forwardRef(
|
|
5563
5611
|
({
|
|
5564
5612
|
src,
|
|
5565
5613
|
title,
|
|
@@ -5579,7 +5627,7 @@ var AudioCard = import_react70.default.forwardRef(
|
|
|
5579
5627
|
loading,
|
|
5580
5628
|
...props
|
|
5581
5629
|
}, ref) => {
|
|
5582
|
-
return /* @__PURE__ */
|
|
5630
|
+
return /* @__PURE__ */ import_react71.default.createElement(
|
|
5583
5631
|
Card,
|
|
5584
5632
|
{
|
|
5585
5633
|
ref,
|
|
@@ -5587,10 +5635,10 @@ var AudioCard = import_react70.default.forwardRef(
|
|
|
5587
5635
|
loading,
|
|
5588
5636
|
...props
|
|
5589
5637
|
},
|
|
5590
|
-
/* @__PURE__ */
|
|
5638
|
+
/* @__PURE__ */ import_react71.default.createElement(Card.Media, { className: cx(
|
|
5591
5639
|
"bg-obsidian py-8 flex flex-col items-center justify-center",
|
|
5592
5640
|
mediaClassName
|
|
5593
|
-
) }, /* @__PURE__ */
|
|
5641
|
+
) }, /* @__PURE__ */ import_react71.default.createElement("div", { className: "mb-4 text-gold" }, /* @__PURE__ */ import_react71.default.createElement(import_lucide_react16.Music, { size: 48 })), src && /* @__PURE__ */ import_react71.default.createElement("div", { className: "w-full px-4" }, /* @__PURE__ */ import_react71.default.createElement(
|
|
5594
5642
|
import_react_player2.default,
|
|
5595
5643
|
{
|
|
5596
5644
|
src,
|
|
@@ -5605,7 +5653,7 @@ var AudioCard = import_react70.default.forwardRef(
|
|
|
5605
5653
|
...playerProps
|
|
5606
5654
|
}
|
|
5607
5655
|
))),
|
|
5608
|
-
/* @__PURE__ */
|
|
5656
|
+
/* @__PURE__ */ import_react71.default.createElement(
|
|
5609
5657
|
Card.Header,
|
|
5610
5658
|
{
|
|
5611
5659
|
title,
|
|
@@ -5614,16 +5662,16 @@ var AudioCard = import_react70.default.forwardRef(
|
|
|
5614
5662
|
className: contentClassName
|
|
5615
5663
|
}
|
|
5616
5664
|
),
|
|
5617
|
-
children && /* @__PURE__ */
|
|
5665
|
+
children && /* @__PURE__ */ import_react71.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5618
5666
|
);
|
|
5619
5667
|
}
|
|
5620
5668
|
);
|
|
5621
5669
|
AudioCard.displayName = "AudioCard";
|
|
5622
5670
|
|
|
5623
5671
|
// src/components/PdfCard.tsx
|
|
5624
|
-
var
|
|
5672
|
+
var import_react72 = __toESM(require("react"));
|
|
5625
5673
|
var import_lucide_react17 = require("lucide-react");
|
|
5626
|
-
var PdfCard =
|
|
5674
|
+
var PdfCard = import_react72.default.forwardRef(
|
|
5627
5675
|
({
|
|
5628
5676
|
src,
|
|
5629
5677
|
title,
|
|
@@ -5637,7 +5685,7 @@ var PdfCard = import_react71.default.forwardRef(
|
|
|
5637
5685
|
loading,
|
|
5638
5686
|
...props
|
|
5639
5687
|
}, ref) => {
|
|
5640
|
-
return /* @__PURE__ */
|
|
5688
|
+
return /* @__PURE__ */ import_react72.default.createElement(
|
|
5641
5689
|
Card,
|
|
5642
5690
|
{
|
|
5643
5691
|
ref,
|
|
@@ -5645,13 +5693,13 @@ var PdfCard = import_react71.default.forwardRef(
|
|
|
5645
5693
|
loading,
|
|
5646
5694
|
...props
|
|
5647
5695
|
},
|
|
5648
|
-
/* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ import_react72.default.createElement(
|
|
5649
5697
|
Card.Media,
|
|
5650
5698
|
{
|
|
5651
5699
|
className: cx("bg-obsidian", mediaClassName),
|
|
5652
5700
|
style: { height }
|
|
5653
5701
|
},
|
|
5654
|
-
src && /* @__PURE__ */
|
|
5702
|
+
src && /* @__PURE__ */ import_react72.default.createElement(
|
|
5655
5703
|
"iframe",
|
|
5656
5704
|
{
|
|
5657
5705
|
src: `${src}#view=FitH`,
|
|
@@ -5660,24 +5708,24 @@ var PdfCard = import_react71.default.forwardRef(
|
|
|
5660
5708
|
}
|
|
5661
5709
|
)
|
|
5662
5710
|
),
|
|
5663
|
-
/* @__PURE__ */
|
|
5711
|
+
/* @__PURE__ */ import_react72.default.createElement(
|
|
5664
5712
|
Card.Header,
|
|
5665
5713
|
{
|
|
5666
5714
|
title,
|
|
5667
5715
|
subtitle,
|
|
5668
5716
|
handle,
|
|
5669
5717
|
className: contentClassName,
|
|
5670
|
-
action: /* @__PURE__ */
|
|
5718
|
+
action: /* @__PURE__ */ import_react72.default.createElement("div", { className: "p-2 bg-ash/20 text-gold shrink-0" }, /* @__PURE__ */ import_react72.default.createElement(import_lucide_react17.FileText, { size: 20 }))
|
|
5671
5719
|
}
|
|
5672
5720
|
),
|
|
5673
|
-
children && /* @__PURE__ */
|
|
5721
|
+
children && /* @__PURE__ */ import_react72.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5674
5722
|
);
|
|
5675
5723
|
}
|
|
5676
5724
|
);
|
|
5677
5725
|
PdfCard.displayName = "PdfCard";
|
|
5678
5726
|
|
|
5679
5727
|
// src/components/ScriptCard.tsx
|
|
5680
|
-
var
|
|
5728
|
+
var import_react73 = __toESM(require("react"));
|
|
5681
5729
|
var SCRIPT_ELEMENT_TYPES = {
|
|
5682
5730
|
SCENE_HEADING: "scene-heading",
|
|
5683
5731
|
ACTION: "action",
|
|
@@ -5691,28 +5739,28 @@ var SCRIPT_ELEMENT_TYPES = {
|
|
|
5691
5739
|
function ScriptElementRenderer({ element }) {
|
|
5692
5740
|
switch (element.type) {
|
|
5693
5741
|
case "scene-heading":
|
|
5694
|
-
return /* @__PURE__ */
|
|
5742
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "mt-4 mb-2 font-bold uppercase text-gold text-xs tracking-wide" }, element.content);
|
|
5695
5743
|
case "action":
|
|
5696
|
-
return /* @__PURE__ */
|
|
5744
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "my-2 text-silver text-xs leading-relaxed" }, element.content);
|
|
5697
5745
|
case "character":
|
|
5698
|
-
return /* @__PURE__ */
|
|
5746
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "mt-4 mb-0.5 ml-8 font-bold text-white text-xs uppercase tracking-wide" }, element.content);
|
|
5699
5747
|
case "parenthetical":
|
|
5700
|
-
return /* @__PURE__ */
|
|
5748
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "ml-6 text-silver/70 text-xs italic" }, "(", element.content, ")");
|
|
5701
5749
|
case "dialogue":
|
|
5702
|
-
return /* @__PURE__ */
|
|
5750
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "ml-4 mr-8 text-silver text-xs leading-relaxed" }, element.content);
|
|
5703
5751
|
case "transition":
|
|
5704
|
-
return /* @__PURE__ */
|
|
5752
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "mt-4 mb-2 text-right font-bold uppercase text-gold/80 text-xs tracking-wide" }, element.content);
|
|
5705
5753
|
case "title":
|
|
5706
|
-
return /* @__PURE__ */
|
|
5754
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "mt-6 mb-2 text-center font-bold text-gold text-sm" }, element.content);
|
|
5707
5755
|
case "subtitle":
|
|
5708
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ import_react73.default.createElement("p", { className: "text-center italic text-gold/70 text-xs" }, element.content);
|
|
5709
5757
|
default:
|
|
5710
5758
|
return null;
|
|
5711
5759
|
}
|
|
5712
5760
|
}
|
|
5713
|
-
var ScriptCard =
|
|
5761
|
+
var ScriptCard = import_react73.default.forwardRef(
|
|
5714
5762
|
({ title, subtitle, handle, elements, maxHeight = "16rem", className, style, loading, ...rest }, ref) => {
|
|
5715
|
-
return /* @__PURE__ */
|
|
5763
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
5716
5764
|
Card,
|
|
5717
5765
|
{
|
|
5718
5766
|
ref,
|
|
@@ -5720,7 +5768,7 @@ var ScriptCard = import_react72.default.forwardRef(
|
|
|
5720
5768
|
loading,
|
|
5721
5769
|
...rest
|
|
5722
5770
|
},
|
|
5723
|
-
/* @__PURE__ */
|
|
5771
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
5724
5772
|
Card.Header,
|
|
5725
5773
|
{
|
|
5726
5774
|
title,
|
|
@@ -5728,13 +5776,13 @@ var ScriptCard = import_react72.default.forwardRef(
|
|
|
5728
5776
|
handle
|
|
5729
5777
|
}
|
|
5730
5778
|
),
|
|
5731
|
-
/* @__PURE__ */
|
|
5779
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
5732
5780
|
Card.Body,
|
|
5733
5781
|
{
|
|
5734
5782
|
className: "font-mono overflow-y-auto",
|
|
5735
5783
|
style: { maxHeight, ...style }
|
|
5736
5784
|
},
|
|
5737
|
-
elements.map((element, index) => /* @__PURE__ */
|
|
5785
|
+
elements.map((element, index) => /* @__PURE__ */ import_react73.default.createElement(ScriptElementRenderer, { key: index, element }))
|
|
5738
5786
|
)
|
|
5739
5787
|
);
|
|
5740
5788
|
}
|
|
@@ -5742,8 +5790,8 @@ var ScriptCard = import_react72.default.forwardRef(
|
|
|
5742
5790
|
ScriptCard.displayName = "ScriptCard";
|
|
5743
5791
|
|
|
5744
5792
|
// src/components/TextCard.tsx
|
|
5745
|
-
var
|
|
5746
|
-
var TextCard =
|
|
5793
|
+
var import_react74 = __toESM(require("react"));
|
|
5794
|
+
var TextCard = import_react74.default.forwardRef(
|
|
5747
5795
|
({
|
|
5748
5796
|
content,
|
|
5749
5797
|
title,
|
|
@@ -5756,7 +5804,7 @@ var TextCard = import_react73.default.forwardRef(
|
|
|
5756
5804
|
loading,
|
|
5757
5805
|
...props
|
|
5758
5806
|
}, ref) => {
|
|
5759
|
-
return /* @__PURE__ */
|
|
5807
|
+
return /* @__PURE__ */ import_react74.default.createElement(
|
|
5760
5808
|
Card,
|
|
5761
5809
|
{
|
|
5762
5810
|
ref,
|
|
@@ -5764,7 +5812,7 @@ var TextCard = import_react73.default.forwardRef(
|
|
|
5764
5812
|
loading,
|
|
5765
5813
|
...props
|
|
5766
5814
|
},
|
|
5767
|
-
/* @__PURE__ */
|
|
5815
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
5768
5816
|
Card.Header,
|
|
5769
5817
|
{
|
|
5770
5818
|
title,
|
|
@@ -5772,13 +5820,13 @@ var TextCard = import_react73.default.forwardRef(
|
|
|
5772
5820
|
handle
|
|
5773
5821
|
}
|
|
5774
5822
|
),
|
|
5775
|
-
/* @__PURE__ */
|
|
5823
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
5776
5824
|
Card.Body,
|
|
5777
5825
|
{
|
|
5778
5826
|
className: cx("overflow-y-auto", contentClassName),
|
|
5779
5827
|
style: { maxHeight }
|
|
5780
5828
|
},
|
|
5781
|
-
/* @__PURE__ */
|
|
5829
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
5782
5830
|
MarkdownContent,
|
|
5783
5831
|
{
|
|
5784
5832
|
content,
|
|
@@ -5793,8 +5841,8 @@ var TextCard = import_react73.default.forwardRef(
|
|
|
5793
5841
|
TextCard.displayName = "TextCard";
|
|
5794
5842
|
|
|
5795
5843
|
// src/components/DeliverableCard.tsx
|
|
5796
|
-
var
|
|
5797
|
-
var DeliverableCard =
|
|
5844
|
+
var import_react75 = __toESM(require("react"));
|
|
5845
|
+
var DeliverableCard = import_react75.default.forwardRef(
|
|
5798
5846
|
({
|
|
5799
5847
|
deliverable,
|
|
5800
5848
|
title,
|
|
@@ -5813,7 +5861,7 @@ var DeliverableCard = import_react74.default.forwardRef(
|
|
|
5813
5861
|
const accent = deliverable?.accentColor?.trim();
|
|
5814
5862
|
const style = accent ? { "--deliverable-accent": accent } : void 0;
|
|
5815
5863
|
const sectionCount = deliverable?.sections.length ?? 0;
|
|
5816
|
-
return /* @__PURE__ */
|
|
5864
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
5817
5865
|
Card,
|
|
5818
5866
|
{
|
|
5819
5867
|
ref,
|
|
@@ -5824,8 +5872,8 @@ var DeliverableCard = import_react74.default.forwardRef(
|
|
|
5824
5872
|
style,
|
|
5825
5873
|
...props
|
|
5826
5874
|
},
|
|
5827
|
-
/* @__PURE__ */
|
|
5828
|
-
/* @__PURE__ */
|
|
5875
|
+
/* @__PURE__ */ import_react75.default.createElement("div", { className: "deliverable-card-cover" }, eyebrow && /* @__PURE__ */ import_react75.default.createElement("p", { className: "deliverable-card-eyebrow" }, eyebrow), headline && /* @__PURE__ */ import_react75.default.createElement("p", { className: "deliverable-card-title" }, headline), tagline && /* @__PURE__ */ import_react75.default.createElement("p", { className: "deliverable-card-subtitle" }, tagline)),
|
|
5876
|
+
/* @__PURE__ */ import_react75.default.createElement("div", { className: "deliverable-card-meta flex items-center justify-between" }, /* @__PURE__ */ import_react75.default.createElement("span", null, sectionCount, " ", sectionCount === 1 ? "section" : "sections"), handle && /* @__PURE__ */ import_react75.default.createElement(Card.Handle, { handle }))
|
|
5829
5877
|
);
|
|
5830
5878
|
}
|
|
5831
5879
|
);
|
|
@@ -5856,7 +5904,7 @@ var ARTIFACT_TYPES = {
|
|
|
5856
5904
|
PDF: "PDF",
|
|
5857
5905
|
DELIVERABLE: "DELIVERABLE"
|
|
5858
5906
|
};
|
|
5859
|
-
var ArtifactCard =
|
|
5907
|
+
var ArtifactCard = import_react76.default.forwardRef(
|
|
5860
5908
|
({ artifact, onExpand, loading, className, ...props }, ref) => {
|
|
5861
5909
|
const derivedLoading = deriveCardSlotLoading(artifact);
|
|
5862
5910
|
const commonProps = {
|
|
@@ -5878,7 +5926,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5878
5926
|
const renderContent = () => {
|
|
5879
5927
|
switch (artifact.type) {
|
|
5880
5928
|
case "IMAGE":
|
|
5881
|
-
return /* @__PURE__ */
|
|
5929
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5882
5930
|
ImageCard,
|
|
5883
5931
|
{
|
|
5884
5932
|
...commonProps,
|
|
@@ -5888,7 +5936,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5888
5936
|
}
|
|
5889
5937
|
);
|
|
5890
5938
|
case "VIDEO":
|
|
5891
|
-
return /* @__PURE__ */
|
|
5939
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5892
5940
|
VideoCard,
|
|
5893
5941
|
{
|
|
5894
5942
|
...commonProps,
|
|
@@ -5898,7 +5946,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5898
5946
|
}
|
|
5899
5947
|
);
|
|
5900
5948
|
case "AUDIO":
|
|
5901
|
-
return /* @__PURE__ */
|
|
5949
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5902
5950
|
AudioCard,
|
|
5903
5951
|
{
|
|
5904
5952
|
...commonProps,
|
|
@@ -5907,7 +5955,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5907
5955
|
}
|
|
5908
5956
|
);
|
|
5909
5957
|
case "PDF":
|
|
5910
|
-
return /* @__PURE__ */
|
|
5958
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5911
5959
|
PdfCard,
|
|
5912
5960
|
{
|
|
5913
5961
|
...commonProps,
|
|
@@ -5915,7 +5963,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5915
5963
|
}
|
|
5916
5964
|
);
|
|
5917
5965
|
case "SCRIPT":
|
|
5918
|
-
return /* @__PURE__ */
|
|
5966
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5919
5967
|
ScriptCard,
|
|
5920
5968
|
{
|
|
5921
5969
|
...commonProps,
|
|
@@ -5924,7 +5972,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5924
5972
|
}
|
|
5925
5973
|
);
|
|
5926
5974
|
case "TEXT":
|
|
5927
|
-
return /* @__PURE__ */
|
|
5975
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5928
5976
|
TextCard,
|
|
5929
5977
|
{
|
|
5930
5978
|
...commonProps,
|
|
@@ -5936,7 +5984,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5936
5984
|
}
|
|
5937
5985
|
);
|
|
5938
5986
|
case "DELIVERABLE":
|
|
5939
|
-
return /* @__PURE__ */
|
|
5987
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5940
5988
|
DeliverableCard,
|
|
5941
5989
|
{
|
|
5942
5990
|
...commonProps,
|
|
@@ -5950,7 +5998,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5950
5998
|
}
|
|
5951
5999
|
};
|
|
5952
6000
|
const isCardExpandable = !!onExpand && (artifact.type === "IMAGE" || artifact.type === "PDF" || artifact.type === "SCRIPT" || artifact.type === "TEXT" || artifact.type === "DELIVERABLE");
|
|
5953
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
5954
6002
|
"div",
|
|
5955
6003
|
{
|
|
5956
6004
|
ref,
|
|
@@ -5963,7 +6011,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5963
6011
|
onClick: isCardExpandable ? handleExpand : void 0,
|
|
5964
6012
|
...props
|
|
5965
6013
|
},
|
|
5966
|
-
onExpand && /* @__PURE__ */
|
|
6014
|
+
onExpand && /* @__PURE__ */ import_react76.default.createElement(
|
|
5967
6015
|
"button",
|
|
5968
6016
|
{
|
|
5969
6017
|
onClick: handleExpand,
|
|
@@ -5974,7 +6022,7 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5974
6022
|
),
|
|
5975
6023
|
"aria-label": "Expand artifact"
|
|
5976
6024
|
},
|
|
5977
|
-
/* @__PURE__ */
|
|
6025
|
+
/* @__PURE__ */ import_react76.default.createElement(ExpandIcon, { className: "w-4 h-4" })
|
|
5978
6026
|
),
|
|
5979
6027
|
renderContent()
|
|
5980
6028
|
);
|
|
@@ -5983,17 +6031,17 @@ var ArtifactCard = import_react75.default.forwardRef(
|
|
|
5983
6031
|
ArtifactCard.displayName = "ArtifactCard";
|
|
5984
6032
|
|
|
5985
6033
|
// src/components/ArtifactGroup.tsx
|
|
5986
|
-
var
|
|
6034
|
+
var import_react77 = __toESM(require("react"));
|
|
5987
6035
|
var LAYER_OFFSET = "8px";
|
|
5988
6036
|
var LAYER_OFFSET_2X = "16px";
|
|
5989
|
-
var ArtifactGroup =
|
|
6037
|
+
var ArtifactGroup = import_react77.default.forwardRef(
|
|
5990
6038
|
({ node, onClick, className, ...props }, ref) => {
|
|
5991
6039
|
const children = node.children;
|
|
5992
6040
|
const count = children.length;
|
|
5993
6041
|
const frontChild = children[0];
|
|
5994
|
-
const prevCountRef = (0,
|
|
5995
|
-
const [badgePing, setBadgePing] = (0,
|
|
5996
|
-
(0,
|
|
6042
|
+
const prevCountRef = (0, import_react77.useRef)(count);
|
|
6043
|
+
const [badgePing, setBadgePing] = (0, import_react77.useState)(false);
|
|
6044
|
+
(0, import_react77.useEffect)(() => {
|
|
5997
6045
|
if (count !== prevCountRef.current) {
|
|
5998
6046
|
prevCountRef.current = count;
|
|
5999
6047
|
setBadgePing(true);
|
|
@@ -6008,21 +6056,21 @@ var ArtifactGroup = import_react76.default.forwardRef(
|
|
|
6008
6056
|
};
|
|
6009
6057
|
const renderFrontContent = () => {
|
|
6010
6058
|
if (!frontChild) {
|
|
6011
|
-
return /* @__PURE__ */
|
|
6059
|
+
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "w-full aspect-video bg-graphite border border-ash/40 flex items-center justify-center" }, /* @__PURE__ */ import_react77.default.createElement("span", { className: "text-silver text-sm" }, "Empty group"));
|
|
6012
6060
|
}
|
|
6013
6061
|
if (frontChild.type === "ARTIFACT" && frontChild.artifact) {
|
|
6014
|
-
return /* @__PURE__ */
|
|
6062
|
+
return /* @__PURE__ */ import_react77.default.createElement(ArtifactCard, { artifact: frontChild.artifact, className: "w-full" });
|
|
6015
6063
|
}
|
|
6016
|
-
return /* @__PURE__ */
|
|
6064
|
+
return /* @__PURE__ */ import_react77.default.createElement(
|
|
6017
6065
|
"div",
|
|
6018
6066
|
{
|
|
6019
6067
|
className: "w-full aspect-video bg-graphite border border-gold/30 flex flex-col items-center justify-center gap-2 p-4"
|
|
6020
6068
|
},
|
|
6021
|
-
/* @__PURE__ */
|
|
6022
|
-
/* @__PURE__ */
|
|
6069
|
+
/* @__PURE__ */ import_react77.default.createElement("span", { className: "text-sm text-silver uppercase tracking-wider" }, frontChild.type === "GROUP" ? "Group" : "Variants"),
|
|
6070
|
+
/* @__PURE__ */ import_react77.default.createElement("span", { className: "text-white font-semibold" }, frontChild.label)
|
|
6023
6071
|
);
|
|
6024
6072
|
};
|
|
6025
|
-
return /* @__PURE__ */
|
|
6073
|
+
return /* @__PURE__ */ import_react77.default.createElement(
|
|
6026
6074
|
"div",
|
|
6027
6075
|
{
|
|
6028
6076
|
ref,
|
|
@@ -6042,21 +6090,21 @@ var ArtifactGroup = import_react76.default.forwardRef(
|
|
|
6042
6090
|
"aria-label": `${node.label} \u2014 ${count} items`,
|
|
6043
6091
|
...props
|
|
6044
6092
|
},
|
|
6045
|
-
/* @__PURE__ */
|
|
6093
|
+
/* @__PURE__ */ import_react77.default.createElement(Card, { noPadding: true, className: "p-5" }, /* @__PURE__ */ import_react77.default.createElement("h3", { className: "text-lg font-semibold text-white m-0 mb-4" }, node.label), /* @__PURE__ */ import_react77.default.createElement("div", { style: { paddingRight: LAYER_OFFSET_2X, paddingBottom: LAYER_OFFSET_2X } }, /* @__PURE__ */ import_react77.default.createElement("div", { className: "relative" }, /* @__PURE__ */ import_react77.default.createElement(
|
|
6046
6094
|
"div",
|
|
6047
6095
|
{
|
|
6048
6096
|
className: "absolute inset-0 bg-charcoal border border-ash/30 pointer-events-none",
|
|
6049
6097
|
style: { transform: `translate(${LAYER_OFFSET_2X}, ${LAYER_OFFSET_2X})` },
|
|
6050
6098
|
"aria-hidden": "true"
|
|
6051
6099
|
}
|
|
6052
|
-
), /* @__PURE__ */
|
|
6100
|
+
), /* @__PURE__ */ import_react77.default.createElement(
|
|
6053
6101
|
"div",
|
|
6054
6102
|
{
|
|
6055
6103
|
className: "absolute inset-0 bg-charcoal border border-ash/40 pointer-events-none",
|
|
6056
6104
|
style: { transform: `translate(${LAYER_OFFSET}, ${LAYER_OFFSET})` },
|
|
6057
6105
|
"aria-hidden": "true"
|
|
6058
6106
|
}
|
|
6059
|
-
), /* @__PURE__ */
|
|
6107
|
+
), /* @__PURE__ */ import_react77.default.createElement("div", { className: "relative transition-transform duration-200 group-hover:-translate-y-0.5" }, renderFrontContent()), /* @__PURE__ */ import_react77.default.createElement(
|
|
6060
6108
|
"div",
|
|
6061
6109
|
{
|
|
6062
6110
|
className: "absolute -top-2 -right-2 z-10 min-w-6 h-6 px-1.5 flex items-center justify-center bg-gold text-obsidian text-xs font-bold",
|
|
@@ -6070,13 +6118,13 @@ var ArtifactGroup = import_react76.default.forwardRef(
|
|
|
6070
6118
|
ArtifactGroup.displayName = "ArtifactGroup";
|
|
6071
6119
|
|
|
6072
6120
|
// src/components/ArtifactVariantStack.tsx
|
|
6073
|
-
var
|
|
6074
|
-
var ArtifactVariantStack =
|
|
6121
|
+
var import_react78 = __toESM(require("react"));
|
|
6122
|
+
var ArtifactVariantStack = import_react78.default.forwardRef(
|
|
6075
6123
|
({ node, onExpandArtifact, onGroupClick, className, ...props }, ref) => {
|
|
6076
6124
|
const children = node.children;
|
|
6077
6125
|
const renderChild = (child) => {
|
|
6078
6126
|
if (child.type === "ARTIFACT" && child.artifact) {
|
|
6079
|
-
return /* @__PURE__ */
|
|
6127
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", { key: child.id, className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react78.default.createElement(
|
|
6080
6128
|
ArtifactCard,
|
|
6081
6129
|
{
|
|
6082
6130
|
artifact: child.artifact,
|
|
@@ -6086,18 +6134,18 @@ var ArtifactVariantStack = import_react77.default.forwardRef(
|
|
|
6086
6134
|
));
|
|
6087
6135
|
}
|
|
6088
6136
|
if (child.type === "GROUP") {
|
|
6089
|
-
return /* @__PURE__ */
|
|
6137
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", { key: child.id, className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react78.default.createElement(ArtifactGroup, { node: child, onClick: onGroupClick }));
|
|
6090
6138
|
}
|
|
6091
|
-
return /* @__PURE__ */
|
|
6139
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", { key: child.id, className: "flex-1 min-w-0" }, /* @__PURE__ */ import_react78.default.createElement(
|
|
6092
6140
|
"div",
|
|
6093
6141
|
{
|
|
6094
6142
|
className: "aspect-video bg-graphite border border-gold/30 flex flex-col items-center justify-center gap-2 p-4"
|
|
6095
6143
|
},
|
|
6096
|
-
/* @__PURE__ */
|
|
6097
|
-
/* @__PURE__ */
|
|
6144
|
+
/* @__PURE__ */ import_react78.default.createElement("span", { className: "text-xs text-silver uppercase tracking-wider" }, "Variants"),
|
|
6145
|
+
/* @__PURE__ */ import_react78.default.createElement("span", { className: "text-sm text-white font-semibold truncate max-w-full" }, child.label)
|
|
6098
6146
|
));
|
|
6099
6147
|
};
|
|
6100
|
-
return /* @__PURE__ */
|
|
6148
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
6101
6149
|
Card,
|
|
6102
6150
|
{
|
|
6103
6151
|
ref,
|
|
@@ -6105,27 +6153,27 @@ var ArtifactVariantStack = import_react77.default.forwardRef(
|
|
|
6105
6153
|
className: cx("w-full p-5", className),
|
|
6106
6154
|
...props
|
|
6107
6155
|
},
|
|
6108
|
-
/* @__PURE__ */
|
|
6109
|
-
/* @__PURE__ */
|
|
6156
|
+
/* @__PURE__ */ import_react78.default.createElement("h3", { className: "text-lg font-semibold text-white m-0 mb-4" }, node.label),
|
|
6157
|
+
/* @__PURE__ */ import_react78.default.createElement("div", { className: "flex gap-3" }, children.map(renderChild))
|
|
6110
6158
|
);
|
|
6111
6159
|
}
|
|
6112
6160
|
);
|
|
6113
6161
|
ArtifactVariantStack.displayName = "ArtifactVariantStack";
|
|
6114
6162
|
|
|
6115
6163
|
// src/components/ArtifactLightboxBody.tsx
|
|
6116
|
-
var
|
|
6164
|
+
var import_react86 = __toESM(require("react"));
|
|
6117
6165
|
|
|
6118
6166
|
// src/components/deliverable/DeliverableRenderer.tsx
|
|
6119
|
-
var
|
|
6167
|
+
var import_react85 = __toESM(require("react"));
|
|
6120
6168
|
|
|
6121
6169
|
// src/components/deliverable/CoverSection.tsx
|
|
6122
|
-
var
|
|
6170
|
+
var import_react79 = __toESM(require("react"));
|
|
6123
6171
|
function CoverSection({ data, clientName }) {
|
|
6124
|
-
return /* @__PURE__ */
|
|
6172
|
+
return /* @__PURE__ */ import_react79.default.createElement("section", { className: "deliverable-cover deliverable-page" }, /* @__PURE__ */ import_react79.default.createElement("div", { className: "deliverable-cover-inner" }, data.eyebrow && /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, /* @__PURE__ */ import_react79.default.createElement("p", { className: "deliverable-cover-eyebrow" }, data.eyebrow), /* @__PURE__ */ import_react79.default.createElement("div", { className: "deliverable-cover-rule", "aria-hidden": "true" })), /* @__PURE__ */ import_react79.default.createElement("h1", { className: "deliverable-cover-title" }, data.title), data.subtitle && /* @__PURE__ */ import_react79.default.createElement("p", { className: "deliverable-cover-subtitle" }, data.subtitle), clientName && /* @__PURE__ */ import_react79.default.createElement("p", { className: "deliverable-cover-client" }, "Prepared for", " ", /* @__PURE__ */ import_react79.default.createElement("span", { className: "deliverable-cover-client-name" }, clientName))));
|
|
6125
6173
|
}
|
|
6126
6174
|
|
|
6127
6175
|
// src/components/deliverable/ArtifactImageGridSection.tsx
|
|
6128
|
-
var
|
|
6176
|
+
var import_react80 = __toESM(require("react"));
|
|
6129
6177
|
var COLUMN_CLASSES = {
|
|
6130
6178
|
1: "deliverable-image-grid-cols-1",
|
|
6131
6179
|
2: "deliverable-image-grid-cols-2",
|
|
@@ -6140,7 +6188,7 @@ var ASPECT_CLASSES = {
|
|
|
6140
6188
|
function ArtifactImageGridSection({ data }) {
|
|
6141
6189
|
const columns = clampColumns(data.columns);
|
|
6142
6190
|
const aspect = data.aspectRatio ?? "landscape";
|
|
6143
|
-
return /* @__PURE__ */
|
|
6191
|
+
return /* @__PURE__ */ import_react80.default.createElement("section", { className: "deliverable-page" }, data.heading && /* @__PURE__ */ import_react80.default.createElement("h2", { className: "deliverable-heading" }, data.heading), /* @__PURE__ */ import_react80.default.createElement(
|
|
6144
6192
|
"div",
|
|
6145
6193
|
{
|
|
6146
6194
|
className: cx(
|
|
@@ -6149,14 +6197,14 @@ function ArtifactImageGridSection({ data }) {
|
|
|
6149
6197
|
ASPECT_CLASSES[aspect]
|
|
6150
6198
|
)
|
|
6151
6199
|
},
|
|
6152
|
-
data.items.map((item, idx) => /* @__PURE__ */
|
|
6200
|
+
data.items.map((item, idx) => /* @__PURE__ */ import_react80.default.createElement("figure", { key: idx, className: "deliverable-image-item" }, item.artifact.url ? /* @__PURE__ */ import_react80.default.createElement(
|
|
6153
6201
|
"img",
|
|
6154
6202
|
{
|
|
6155
6203
|
src: item.artifact.url,
|
|
6156
6204
|
alt: item.artifact.title ?? "",
|
|
6157
6205
|
className: "deliverable-image-img"
|
|
6158
6206
|
}
|
|
6159
|
-
) : /* @__PURE__ */
|
|
6207
|
+
) : /* @__PURE__ */ import_react80.default.createElement("div", { className: "deliverable-image-missing" }, "Missing image"), item.caption && /* @__PURE__ */ import_react80.default.createElement("figcaption", { className: "deliverable-image-caption" }, item.caption)))
|
|
6160
6208
|
));
|
|
6161
6209
|
}
|
|
6162
6210
|
function clampColumns(n) {
|
|
@@ -6166,7 +6214,7 @@ function clampColumns(n) {
|
|
|
6166
6214
|
}
|
|
6167
6215
|
|
|
6168
6216
|
// src/components/deliverable/ArtifactSpotlightSection.tsx
|
|
6169
|
-
var
|
|
6217
|
+
var import_react81 = __toESM(require("react"));
|
|
6170
6218
|
var VARIANT_CLASSES = {
|
|
6171
6219
|
framed: null,
|
|
6172
6220
|
"full-bleed": "deliverable-spotlight-variant-full-bleed",
|
|
@@ -6174,14 +6222,14 @@ var VARIANT_CLASSES = {
|
|
|
6174
6222
|
};
|
|
6175
6223
|
function ArtifactSpotlightSection({ data }) {
|
|
6176
6224
|
const variant = data.variant ?? "framed";
|
|
6177
|
-
return /* @__PURE__ */
|
|
6225
|
+
return /* @__PURE__ */ import_react81.default.createElement("section", { className: cx("deliverable-page", VARIANT_CLASSES[variant]) }, data.heading && /* @__PURE__ */ import_react81.default.createElement("h2", { className: "deliverable-heading" }, data.heading), /* @__PURE__ */ import_react81.default.createElement("div", { className: "deliverable-spotlight-media" }, data.artifact.url ? /* @__PURE__ */ import_react81.default.createElement(
|
|
6178
6226
|
"img",
|
|
6179
6227
|
{
|
|
6180
6228
|
src: data.artifact.url,
|
|
6181
6229
|
alt: data.artifact.title ?? "",
|
|
6182
6230
|
className: "deliverable-spotlight-img"
|
|
6183
6231
|
}
|
|
6184
|
-
) : /* @__PURE__ */
|
|
6232
|
+
) : /* @__PURE__ */ import_react81.default.createElement("div", { className: "deliverable-spotlight-missing" }, "Missing image")), data.body && /* @__PURE__ */ import_react81.default.createElement(
|
|
6185
6233
|
MarkdownContent,
|
|
6186
6234
|
{
|
|
6187
6235
|
content: data.body,
|
|
@@ -6191,9 +6239,9 @@ function ArtifactSpotlightSection({ data }) {
|
|
|
6191
6239
|
}
|
|
6192
6240
|
|
|
6193
6241
|
// src/components/deliverable/TextBlockSection.tsx
|
|
6194
|
-
var
|
|
6242
|
+
var import_react82 = __toESM(require("react"));
|
|
6195
6243
|
function TextBlockSection({ data }) {
|
|
6196
|
-
return /* @__PURE__ */
|
|
6244
|
+
return /* @__PURE__ */ import_react82.default.createElement("section", { className: "deliverable-page" }, data.heading && /* @__PURE__ */ import_react82.default.createElement("h2", { className: "deliverable-heading" }, data.heading), /* @__PURE__ */ import_react82.default.createElement(
|
|
6197
6245
|
MarkdownContent,
|
|
6198
6246
|
{
|
|
6199
6247
|
content: data.body,
|
|
@@ -6203,22 +6251,22 @@ function TextBlockSection({ data }) {
|
|
|
6203
6251
|
}
|
|
6204
6252
|
|
|
6205
6253
|
// src/components/deliverable/ColorPaletteSection.tsx
|
|
6206
|
-
var
|
|
6254
|
+
var import_react83 = __toESM(require("react"));
|
|
6207
6255
|
function ColorPaletteSection({ data }) {
|
|
6208
|
-
return /* @__PURE__ */
|
|
6256
|
+
return /* @__PURE__ */ import_react83.default.createElement("section", { className: "deliverable-page" }, data.heading && /* @__PURE__ */ import_react83.default.createElement("h2", { className: "deliverable-heading" }, data.heading), /* @__PURE__ */ import_react83.default.createElement("div", { className: "deliverable-palette" }, data.swatches.map((swatch, idx) => /* @__PURE__ */ import_react83.default.createElement("div", { key: idx, className: "deliverable-palette-item" }, /* @__PURE__ */ import_react83.default.createElement(
|
|
6209
6257
|
"div",
|
|
6210
6258
|
{
|
|
6211
6259
|
className: "deliverable-palette-chip",
|
|
6212
6260
|
style: { backgroundColor: swatch.color },
|
|
6213
6261
|
"aria-label": swatch.label
|
|
6214
6262
|
}
|
|
6215
|
-
), /* @__PURE__ */
|
|
6263
|
+
), /* @__PURE__ */ import_react83.default.createElement("p", { className: "deliverable-palette-label" }, swatch.label), /* @__PURE__ */ import_react83.default.createElement("p", { className: "deliverable-palette-hex" }, swatch.color.toUpperCase())))));
|
|
6216
6264
|
}
|
|
6217
6265
|
|
|
6218
6266
|
// src/components/deliverable/QuoteBlockSection.tsx
|
|
6219
|
-
var
|
|
6267
|
+
var import_react84 = __toESM(require("react"));
|
|
6220
6268
|
function QuoteBlockSection({ data }) {
|
|
6221
|
-
return /* @__PURE__ */
|
|
6269
|
+
return /* @__PURE__ */ import_react84.default.createElement("section", { className: "deliverable-page deliverable-quote" }, /* @__PURE__ */ import_react84.default.createElement("blockquote", { className: "deliverable-quote-body" }, /* @__PURE__ */ import_react84.default.createElement("p", { className: "deliverable-quote-text" }, "\u201C", data.quote, "\u201D"), data.attribution && /* @__PURE__ */ import_react84.default.createElement("footer", { className: "deliverable-quote-attribution" }, "\u2014 ", data.attribution)));
|
|
6222
6270
|
}
|
|
6223
6271
|
|
|
6224
6272
|
// src/components/deliverable/DeliverableRenderer.tsx
|
|
@@ -6234,7 +6282,7 @@ function DeliverableRenderer({
|
|
|
6234
6282
|
hideActions = false,
|
|
6235
6283
|
className
|
|
6236
6284
|
}) {
|
|
6237
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
6285
|
+
const [isDownloading, setIsDownloading] = (0, import_react85.useState)(false);
|
|
6238
6286
|
const accent = deliverable.accentColor?.trim();
|
|
6239
6287
|
const style = accent ? { "--deliverable-accent": accent } : void 0;
|
|
6240
6288
|
const theme = deliverable.theme ?? "cinematic";
|
|
@@ -6248,14 +6296,14 @@ function DeliverableRenderer({
|
|
|
6248
6296
|
setIsDownloading(false);
|
|
6249
6297
|
}
|
|
6250
6298
|
};
|
|
6251
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ import_react85.default.createElement(
|
|
6252
6300
|
"div",
|
|
6253
6301
|
{
|
|
6254
6302
|
className: cx("deliverable", themeClass, className),
|
|
6255
6303
|
style
|
|
6256
6304
|
},
|
|
6257
6305
|
deliverable.sections.map((section, idx) => renderSection(section, idx, deliverable)),
|
|
6258
|
-
!hideActions && onDownloadPdf && /* @__PURE__ */
|
|
6306
|
+
!hideActions && onDownloadPdf && /* @__PURE__ */ import_react85.default.createElement("div", { className: "deliverable-actions" }, /* @__PURE__ */ import_react85.default.createElement(
|
|
6259
6307
|
Button,
|
|
6260
6308
|
{
|
|
6261
6309
|
variant: "important",
|
|
@@ -6272,7 +6320,7 @@ function renderSection(section, idx, doc) {
|
|
|
6272
6320
|
const key = `${section.type}-${idx}`;
|
|
6273
6321
|
switch (section.type) {
|
|
6274
6322
|
case "COVER":
|
|
6275
|
-
return /* @__PURE__ */
|
|
6323
|
+
return /* @__PURE__ */ import_react85.default.createElement(
|
|
6276
6324
|
CoverSection,
|
|
6277
6325
|
{
|
|
6278
6326
|
key,
|
|
@@ -6281,15 +6329,15 @@ function renderSection(section, idx, doc) {
|
|
|
6281
6329
|
}
|
|
6282
6330
|
);
|
|
6283
6331
|
case "ARTIFACT_IMAGE_GRID":
|
|
6284
|
-
return /* @__PURE__ */
|
|
6332
|
+
return /* @__PURE__ */ import_react85.default.createElement(ArtifactImageGridSection, { key, data: section });
|
|
6285
6333
|
case "ARTIFACT_SPOTLIGHT":
|
|
6286
|
-
return /* @__PURE__ */
|
|
6334
|
+
return /* @__PURE__ */ import_react85.default.createElement(ArtifactSpotlightSection, { key, data: section });
|
|
6287
6335
|
case "TEXT_BLOCK":
|
|
6288
|
-
return /* @__PURE__ */
|
|
6336
|
+
return /* @__PURE__ */ import_react85.default.createElement(TextBlockSection, { key, data: section });
|
|
6289
6337
|
case "COLOR_PALETTE":
|
|
6290
|
-
return /* @__PURE__ */
|
|
6338
|
+
return /* @__PURE__ */ import_react85.default.createElement(ColorPaletteSection, { key, data: section });
|
|
6291
6339
|
case "QUOTE_BLOCK":
|
|
6292
|
-
return /* @__PURE__ */
|
|
6340
|
+
return /* @__PURE__ */ import_react85.default.createElement(QuoteBlockSection, { key, data: section });
|
|
6293
6341
|
default:
|
|
6294
6342
|
return null;
|
|
6295
6343
|
}
|
|
@@ -6300,9 +6348,9 @@ function ArtifactLightboxBody({ artifact }) {
|
|
|
6300
6348
|
switch (artifact.type) {
|
|
6301
6349
|
case ARTIFACT_TYPES.DELIVERABLE: {
|
|
6302
6350
|
if (!artifact.deliverable) {
|
|
6303
|
-
return /* @__PURE__ */
|
|
6351
|
+
return /* @__PURE__ */ import_react86.default.createElement(ArtifactCard, { artifact });
|
|
6304
6352
|
}
|
|
6305
|
-
return /* @__PURE__ */
|
|
6353
|
+
return /* @__PURE__ */ import_react86.default.createElement("div", { className: "w-full h-full overflow-auto" }, /* @__PURE__ */ import_react86.default.createElement(
|
|
6306
6354
|
DeliverableRenderer,
|
|
6307
6355
|
{
|
|
6308
6356
|
deliverable: artifact.deliverable,
|
|
@@ -6312,9 +6360,9 @@ function ArtifactLightboxBody({ artifact }) {
|
|
|
6312
6360
|
}
|
|
6313
6361
|
case ARTIFACT_TYPES.IMAGE: {
|
|
6314
6362
|
if (!artifact.url) {
|
|
6315
|
-
return /* @__PURE__ */
|
|
6363
|
+
return /* @__PURE__ */ import_react86.default.createElement(ArtifactCard, { artifact });
|
|
6316
6364
|
}
|
|
6317
|
-
return /* @__PURE__ */
|
|
6365
|
+
return /* @__PURE__ */ import_react86.default.createElement(
|
|
6318
6366
|
"img",
|
|
6319
6367
|
{
|
|
6320
6368
|
src: artifact.url,
|
|
@@ -6325,9 +6373,9 @@ function ArtifactLightboxBody({ artifact }) {
|
|
|
6325
6373
|
}
|
|
6326
6374
|
case ARTIFACT_TYPES.VIDEO: {
|
|
6327
6375
|
if (!artifact.url) {
|
|
6328
|
-
return /* @__PURE__ */
|
|
6376
|
+
return /* @__PURE__ */ import_react86.default.createElement(ArtifactCard, { artifact });
|
|
6329
6377
|
}
|
|
6330
|
-
return /* @__PURE__ */
|
|
6378
|
+
return /* @__PURE__ */ import_react86.default.createElement(
|
|
6331
6379
|
"video",
|
|
6332
6380
|
{
|
|
6333
6381
|
src: artifact.url,
|
|
@@ -6338,9 +6386,9 @@ function ArtifactLightboxBody({ artifact }) {
|
|
|
6338
6386
|
}
|
|
6339
6387
|
case ARTIFACT_TYPES.AUDIO: {
|
|
6340
6388
|
if (!artifact.url) {
|
|
6341
|
-
return /* @__PURE__ */
|
|
6389
|
+
return /* @__PURE__ */ import_react86.default.createElement(ArtifactCard, { artifact });
|
|
6342
6390
|
}
|
|
6343
|
-
return /* @__PURE__ */
|
|
6391
|
+
return /* @__PURE__ */ import_react86.default.createElement(
|
|
6344
6392
|
"audio",
|
|
6345
6393
|
{
|
|
6346
6394
|
src: artifact.url,
|
|
@@ -6350,7 +6398,7 @@ function ArtifactLightboxBody({ artifact }) {
|
|
|
6350
6398
|
);
|
|
6351
6399
|
}
|
|
6352
6400
|
default:
|
|
6353
|
-
return /* @__PURE__ */
|
|
6401
|
+
return /* @__PURE__ */ import_react86.default.createElement(ArtifactCard, { artifact });
|
|
6354
6402
|
}
|
|
6355
6403
|
}
|
|
6356
6404
|
function getArtifactLightboxCaption(artifact) {
|
|
@@ -6360,30 +6408,30 @@ function getArtifactLightboxCaption(artifact) {
|
|
|
6360
6408
|
if (!artifact.title && !artifact.subtitle) {
|
|
6361
6409
|
return null;
|
|
6362
6410
|
}
|
|
6363
|
-
return /* @__PURE__ */
|
|
6411
|
+
return /* @__PURE__ */ import_react86.default.createElement("div", { className: "inline-flex flex-col items-center gap-1 px-4 py-2 bg-charcoal/70 backdrop-blur border border-ash/40" }, artifact.title && /* @__PURE__ */ import_react86.default.createElement("p", { className: "text-xs uppercase tracking-wider text-silver" }, artifact.title), artifact.subtitle && /* @__PURE__ */ import_react86.default.createElement("p", { className: "text-xs text-silver/70" }, artifact.subtitle));
|
|
6364
6412
|
}
|
|
6365
6413
|
|
|
6366
6414
|
// src/components/chat/hooks/useResizable.ts
|
|
6367
|
-
var
|
|
6415
|
+
var import_react87 = require("react");
|
|
6368
6416
|
function useResizable({
|
|
6369
6417
|
initialWidthPercent,
|
|
6370
6418
|
minWidthPercent,
|
|
6371
6419
|
maxWidthPercent,
|
|
6372
6420
|
direction
|
|
6373
6421
|
}) {
|
|
6374
|
-
const [widthPercent, setWidthPercent] = (0,
|
|
6375
|
-
const [isResizing, setIsResizing] = (0,
|
|
6376
|
-
const lastX = (0,
|
|
6377
|
-
const startResizing = (0,
|
|
6422
|
+
const [widthPercent, setWidthPercent] = (0, import_react87.useState)(initialWidthPercent);
|
|
6423
|
+
const [isResizing, setIsResizing] = (0, import_react87.useState)(false);
|
|
6424
|
+
const lastX = (0, import_react87.useRef)(null);
|
|
6425
|
+
const startResizing = (0, import_react87.useCallback)((e) => {
|
|
6378
6426
|
e.preventDefault();
|
|
6379
6427
|
setIsResizing(true);
|
|
6380
6428
|
lastX.current = e.clientX;
|
|
6381
6429
|
}, []);
|
|
6382
|
-
const stopResizing = (0,
|
|
6430
|
+
const stopResizing = (0, import_react87.useCallback)(() => {
|
|
6383
6431
|
setIsResizing(false);
|
|
6384
6432
|
lastX.current = null;
|
|
6385
6433
|
}, []);
|
|
6386
|
-
const resize = (0,
|
|
6434
|
+
const resize = (0, import_react87.useCallback)(
|
|
6387
6435
|
(e) => {
|
|
6388
6436
|
if (!isResizing || lastX.current === null) {
|
|
6389
6437
|
return;
|
|
@@ -6399,7 +6447,7 @@ function useResizable({
|
|
|
6399
6447
|
},
|
|
6400
6448
|
[isResizing, direction, minWidthPercent, maxWidthPercent]
|
|
6401
6449
|
);
|
|
6402
|
-
(0,
|
|
6450
|
+
(0, import_react87.useEffect)(() => {
|
|
6403
6451
|
if (isResizing) {
|
|
6404
6452
|
window.addEventListener("mousemove", resize);
|
|
6405
6453
|
window.addEventListener("mouseup", stopResizing);
|
|
@@ -6423,14 +6471,14 @@ function useResizable({
|
|
|
6423
6471
|
}
|
|
6424
6472
|
|
|
6425
6473
|
// src/components/chat/hooks/useArtifactTreeNavigation.ts
|
|
6426
|
-
var
|
|
6474
|
+
var import_react88 = require("react");
|
|
6427
6475
|
function useArtifactTreeNavigation(rootNodes) {
|
|
6428
|
-
const [stack, setStack] = (0,
|
|
6429
|
-
const currentNodes = (0,
|
|
6476
|
+
const [stack, setStack] = (0, import_react88.useState)([]);
|
|
6477
|
+
const currentNodes = (0, import_react88.useMemo)(() => {
|
|
6430
6478
|
if (stack.length === 0) return rootNodes;
|
|
6431
6479
|
return stack[stack.length - 1].children;
|
|
6432
6480
|
}, [rootNodes, stack]);
|
|
6433
|
-
const breadcrumbs = (0,
|
|
6481
|
+
const breadcrumbs = (0, import_react88.useMemo)(() => {
|
|
6434
6482
|
const entries = [{ label: "Project", node: null }];
|
|
6435
6483
|
for (const node of stack) {
|
|
6436
6484
|
entries.push({ label: node.label, node });
|
|
@@ -6438,13 +6486,13 @@ function useArtifactTreeNavigation(rootNodes) {
|
|
|
6438
6486
|
return entries;
|
|
6439
6487
|
}, [stack]);
|
|
6440
6488
|
const isAtRoot = stack.length === 0;
|
|
6441
|
-
const navigateInto = (0,
|
|
6489
|
+
const navigateInto = (0, import_react88.useCallback)((node) => {
|
|
6442
6490
|
setStack((prev) => [...prev, node]);
|
|
6443
6491
|
}, []);
|
|
6444
|
-
const navigateTo = (0,
|
|
6492
|
+
const navigateTo = (0, import_react88.useCallback)((index) => {
|
|
6445
6493
|
setStack((prev) => prev.slice(0, index));
|
|
6446
6494
|
}, []);
|
|
6447
|
-
const navigateBack = (0,
|
|
6495
|
+
const navigateBack = (0, import_react88.useCallback)(() => {
|
|
6448
6496
|
setStack((prev) => prev.slice(0, -1));
|
|
6449
6497
|
}, []);
|
|
6450
6498
|
return {
|
|
@@ -6459,19 +6507,25 @@ function useArtifactTreeNavigation(rootNodes) {
|
|
|
6459
6507
|
|
|
6460
6508
|
// src/components/chat/ArtifactsPanel.tsx
|
|
6461
6509
|
var ZOOM_LEVELS = [0.25, 0.5, 0.75, 1];
|
|
6510
|
+
var FULL_CARD_SLOT_LOADING = {
|
|
6511
|
+
header: { title: true, subtitle: true },
|
|
6512
|
+
media: true,
|
|
6513
|
+
body: true
|
|
6514
|
+
};
|
|
6515
|
+
var COLD_START_PLACEHOLDER_COUNT = 3;
|
|
6462
6516
|
function ArtifactLightbox({
|
|
6463
6517
|
artifact,
|
|
6464
6518
|
onClose,
|
|
6465
6519
|
getArtifactActions
|
|
6466
6520
|
}) {
|
|
6467
|
-
return /* @__PURE__ */
|
|
6521
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
6468
6522
|
Lightbox,
|
|
6469
6523
|
{
|
|
6470
6524
|
onClose,
|
|
6471
6525
|
actions: getArtifactActions?.(artifact, { onClose }),
|
|
6472
6526
|
caption: getArtifactLightboxCaption(artifact)
|
|
6473
6527
|
},
|
|
6474
|
-
/* @__PURE__ */
|
|
6528
|
+
/* @__PURE__ */ import_react89.default.createElement(ArtifactLightboxBody, { artifact })
|
|
6475
6529
|
);
|
|
6476
6530
|
}
|
|
6477
6531
|
function findArtifactInNodes(nodes, artifactId) {
|
|
@@ -6488,6 +6542,9 @@ function findArtifactInNodes(nodes, artifactId) {
|
|
|
6488
6542
|
}
|
|
6489
6543
|
return null;
|
|
6490
6544
|
}
|
|
6545
|
+
function ColdStartPlaceholders() {
|
|
6546
|
+
return /* @__PURE__ */ import_react89.default.createElement(import_react89.default.Fragment, null, Array.from({ length: COLD_START_PLACEHOLDER_COUNT }, (_, i) => /* @__PURE__ */ import_react89.default.createElement(Skeleton, { key: i, className: "w-full aspect-video" })));
|
|
6547
|
+
}
|
|
6491
6548
|
function NodeRenderer({
|
|
6492
6549
|
node,
|
|
6493
6550
|
loading,
|
|
@@ -6495,7 +6552,7 @@ function NodeRenderer({
|
|
|
6495
6552
|
onGroupClick
|
|
6496
6553
|
}) {
|
|
6497
6554
|
if (node.type === "ARTIFACT" && node.artifact) {
|
|
6498
|
-
return /* @__PURE__ */
|
|
6555
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
6499
6556
|
ArtifactCard,
|
|
6500
6557
|
{
|
|
6501
6558
|
artifact: node.artifact,
|
|
@@ -6505,10 +6562,10 @@ function NodeRenderer({
|
|
|
6505
6562
|
);
|
|
6506
6563
|
}
|
|
6507
6564
|
if (node.type === "GROUP") {
|
|
6508
|
-
return /* @__PURE__ */
|
|
6565
|
+
return /* @__PURE__ */ import_react89.default.createElement(ArtifactGroup, { node, onClick: onGroupClick });
|
|
6509
6566
|
}
|
|
6510
6567
|
if (node.type === "VARIANT_SET") {
|
|
6511
|
-
return /* @__PURE__ */
|
|
6568
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
6512
6569
|
ArtifactVariantStack,
|
|
6513
6570
|
{
|
|
6514
6571
|
node,
|
|
@@ -6519,7 +6576,7 @@ function NodeRenderer({
|
|
|
6519
6576
|
}
|
|
6520
6577
|
return null;
|
|
6521
6578
|
}
|
|
6522
|
-
var ArtifactsPanel =
|
|
6579
|
+
var ArtifactsPanel = import_react89.default.forwardRef(
|
|
6523
6580
|
({
|
|
6524
6581
|
nodes,
|
|
6525
6582
|
loading,
|
|
@@ -6529,17 +6586,19 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6529
6586
|
className,
|
|
6530
6587
|
...rest
|
|
6531
6588
|
}, ref) => {
|
|
6532
|
-
const [expandedArtifact, setExpandedArtifact] = (0,
|
|
6533
|
-
const [zoomIndex, setZoomIndex] = (0,
|
|
6589
|
+
const [expandedArtifact, setExpandedArtifact] = (0, import_react89.useState)(null);
|
|
6590
|
+
const [zoomIndex, setZoomIndex] = (0, import_react89.useState)(ZOOM_LEVELS.length - 1);
|
|
6591
|
+
const slotLoading2 = loading === true ? FULL_CARD_SLOT_LOADING : loading || void 0;
|
|
6592
|
+
const showColdStartPlaceholders = !!loading;
|
|
6534
6593
|
const treeNav = useArtifactTreeNavigation(nodes || []);
|
|
6535
6594
|
const hasNodes = !!nodes && nodes.length > 0;
|
|
6536
|
-
const handleExpandArtifact = (0,
|
|
6595
|
+
const handleExpandArtifact = (0, import_react89.useCallback)((artifact) => {
|
|
6537
6596
|
setExpandedArtifact(artifact);
|
|
6538
6597
|
}, []);
|
|
6539
|
-
const handleGroupClick = (0,
|
|
6598
|
+
const handleGroupClick = (0, import_react89.useCallback)((node) => {
|
|
6540
6599
|
treeNav.navigateInto(node);
|
|
6541
6600
|
}, [treeNav]);
|
|
6542
|
-
(0,
|
|
6601
|
+
(0, import_react89.useEffect)(() => {
|
|
6543
6602
|
if (!openArtifactId || !nodes) {
|
|
6544
6603
|
return;
|
|
6545
6604
|
}
|
|
@@ -6548,20 +6607,20 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6548
6607
|
setExpandedArtifact(found);
|
|
6549
6608
|
}
|
|
6550
6609
|
}, [openArtifactId, nodes]);
|
|
6551
|
-
const handleModalClose = (0,
|
|
6610
|
+
const handleModalClose = (0, import_react89.useCallback)(() => {
|
|
6552
6611
|
setExpandedArtifact(null);
|
|
6553
6612
|
onArtifactClosed?.();
|
|
6554
6613
|
}, [onArtifactClosed]);
|
|
6555
|
-
const zoomIn = (0,
|
|
6614
|
+
const zoomIn = (0, import_react89.useCallback)(() => {
|
|
6556
6615
|
setZoomIndex((prev) => Math.min(prev + 1, ZOOM_LEVELS.length - 1));
|
|
6557
6616
|
}, []);
|
|
6558
|
-
const zoomOut = (0,
|
|
6617
|
+
const zoomOut = (0, import_react89.useCallback)(() => {
|
|
6559
6618
|
setZoomIndex((prev) => Math.max(prev - 1, 0));
|
|
6560
6619
|
}, []);
|
|
6561
6620
|
const currentZoom = ZOOM_LEVELS[zoomIndex];
|
|
6562
|
-
const contentRef = (0,
|
|
6563
|
-
const [contentHeight, setContentHeight] = (0,
|
|
6564
|
-
(0,
|
|
6621
|
+
const contentRef = (0, import_react89.useRef)(null);
|
|
6622
|
+
const [contentHeight, setContentHeight] = (0, import_react89.useState)(void 0);
|
|
6623
|
+
(0, import_react89.useEffect)(() => {
|
|
6565
6624
|
const el = contentRef.current;
|
|
6566
6625
|
if (!el) {
|
|
6567
6626
|
return;
|
|
@@ -6572,7 +6631,7 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6572
6631
|
observer.observe(el);
|
|
6573
6632
|
return () => observer.disconnect();
|
|
6574
6633
|
}, []);
|
|
6575
|
-
return /* @__PURE__ */
|
|
6634
|
+
return /* @__PURE__ */ import_react89.default.createElement(import_react89.default.Fragment, null, /* @__PURE__ */ import_react89.default.createElement(
|
|
6576
6635
|
"div",
|
|
6577
6636
|
{
|
|
6578
6637
|
ref,
|
|
@@ -6583,19 +6642,19 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6583
6642
|
),
|
|
6584
6643
|
...rest
|
|
6585
6644
|
},
|
|
6586
|
-
/* @__PURE__ */
|
|
6645
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6587
6646
|
"div",
|
|
6588
6647
|
{
|
|
6589
6648
|
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
6590
6649
|
},
|
|
6591
|
-
/* @__PURE__ */
|
|
6592
|
-
hasNodes && /* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ import_react89.default.createElement("h3", { className: "text-sm font-semibold text-white" }, "Artifacts"),
|
|
6651
|
+
hasNodes && /* @__PURE__ */ import_react89.default.createElement(
|
|
6593
6652
|
"div",
|
|
6594
6653
|
{
|
|
6595
6654
|
className: "flex items-center gap-0.5",
|
|
6596
6655
|
"data-testid": "zoom-controls"
|
|
6597
6656
|
},
|
|
6598
|
-
/* @__PURE__ */
|
|
6657
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6599
6658
|
"button",
|
|
6600
6659
|
{
|
|
6601
6660
|
onClick: zoomOut,
|
|
@@ -6609,7 +6668,7 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6609
6668
|
},
|
|
6610
6669
|
"\u2212"
|
|
6611
6670
|
),
|
|
6612
|
-
/* @__PURE__ */
|
|
6671
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6613
6672
|
"span",
|
|
6614
6673
|
{
|
|
6615
6674
|
className: "text-xs text-silver w-8 text-center tabular-nums",
|
|
@@ -6618,7 +6677,7 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6618
6677
|
Math.round(currentZoom * 100),
|
|
6619
6678
|
"%"
|
|
6620
6679
|
),
|
|
6621
|
-
/* @__PURE__ */
|
|
6680
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6622
6681
|
"button",
|
|
6623
6682
|
{
|
|
6624
6683
|
onClick: zoomIn,
|
|
@@ -6634,7 +6693,7 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6634
6693
|
)
|
|
6635
6694
|
)
|
|
6636
6695
|
),
|
|
6637
|
-
hasNodes && !treeNav.isAtRoot && /* @__PURE__ */
|
|
6696
|
+
hasNodes && !treeNav.isAtRoot && /* @__PURE__ */ import_react89.default.createElement(
|
|
6638
6697
|
"nav",
|
|
6639
6698
|
{
|
|
6640
6699
|
className: "flex items-center gap-1 px-4 py-2 border-b border-ash/40 shrink-0 overflow-x-auto text-xs",
|
|
@@ -6643,7 +6702,7 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6643
6702
|
},
|
|
6644
6703
|
treeNav.breadcrumbs.map((crumb, i) => {
|
|
6645
6704
|
const isLast = i === treeNav.breadcrumbs.length - 1;
|
|
6646
|
-
return /* @__PURE__ */
|
|
6705
|
+
return /* @__PURE__ */ import_react89.default.createElement("span", { key: i, className: "flex items-center gap-1 shrink-0" }, i > 0 && /* @__PURE__ */ import_react89.default.createElement(ChevronRightIcon, { className: "w-3 h-3 text-silver/50", "aria-hidden": true }), isLast ? /* @__PURE__ */ import_react89.default.createElement("span", { className: "text-gold font-medium" }, crumb.label) : /* @__PURE__ */ import_react89.default.createElement(
|
|
6647
6706
|
"button",
|
|
6648
6707
|
{
|
|
6649
6708
|
onClick: () => treeNav.navigateTo(i),
|
|
@@ -6653,18 +6712,18 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6653
6712
|
));
|
|
6654
6713
|
})
|
|
6655
6714
|
),
|
|
6656
|
-
/* @__PURE__ */
|
|
6715
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6657
6716
|
"div",
|
|
6658
6717
|
{
|
|
6659
6718
|
className: "flex-1 overflow-auto relative",
|
|
6660
6719
|
"data-testid": "artifacts-scroll-area"
|
|
6661
6720
|
},
|
|
6662
|
-
/* @__PURE__ */
|
|
6721
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6663
6722
|
"div",
|
|
6664
6723
|
{
|
|
6665
6724
|
style: currentZoom !== 1 && contentHeight !== void 0 ? { height: contentHeight * currentZoom } : void 0
|
|
6666
6725
|
},
|
|
6667
|
-
/* @__PURE__ */
|
|
6726
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
6668
6727
|
"div",
|
|
6669
6728
|
{
|
|
6670
6729
|
ref: contentRef,
|
|
@@ -6675,12 +6734,12 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6675
6734
|
transformOrigin: "top center"
|
|
6676
6735
|
} : void 0
|
|
6677
6736
|
},
|
|
6678
|
-
treeNav.currentNodes.length === 0 ? /* @__PURE__ */
|
|
6737
|
+
treeNav.currentNodes.length === 0 ? showColdStartPlaceholders && !hasNodes ? /* @__PURE__ */ import_react89.default.createElement(ColdStartPlaceholders, null) : /* @__PURE__ */ import_react89.default.createElement("p", { className: "text-xs text-silver/60 text-center py-8" }, hasNodes ? "Empty group" : "No artifacts to display") : treeNav.currentNodes.map((node) => /* @__PURE__ */ import_react89.default.createElement(
|
|
6679
6738
|
NodeRenderer,
|
|
6680
6739
|
{
|
|
6681
6740
|
key: node.id,
|
|
6682
6741
|
node,
|
|
6683
|
-
loading,
|
|
6742
|
+
loading: slotLoading2,
|
|
6684
6743
|
onExpandArtifact: handleExpandArtifact,
|
|
6685
6744
|
onGroupClick: handleGroupClick
|
|
6686
6745
|
}
|
|
@@ -6688,7 +6747,7 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6688
6747
|
)
|
|
6689
6748
|
)
|
|
6690
6749
|
)
|
|
6691
|
-
), expandedArtifact && /* @__PURE__ */
|
|
6750
|
+
), expandedArtifact && /* @__PURE__ */ import_react89.default.createElement(
|
|
6692
6751
|
ArtifactLightbox,
|
|
6693
6752
|
{
|
|
6694
6753
|
artifact: expandedArtifact,
|
|
@@ -6699,8 +6758,8 @@ var ArtifactsPanel = import_react88.default.forwardRef(
|
|
|
6699
6758
|
}
|
|
6700
6759
|
);
|
|
6701
6760
|
ArtifactsPanel.displayName = "ArtifactsPanel";
|
|
6702
|
-
var ArtifactsPanelToggle =
|
|
6703
|
-
return /* @__PURE__ */
|
|
6761
|
+
var ArtifactsPanelToggle = import_react89.default.forwardRef(({ artifactCount = 0, onExpand, className, ...rest }, ref) => {
|
|
6762
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
6704
6763
|
"button",
|
|
6705
6764
|
{
|
|
6706
6765
|
ref,
|
|
@@ -6717,8 +6776,8 @@ var ArtifactsPanelToggle = import_react88.default.forwardRef(({ artifactCount =
|
|
|
6717
6776
|
"aria-label": "Expand artifacts panel",
|
|
6718
6777
|
...rest
|
|
6719
6778
|
},
|
|
6720
|
-
/* @__PURE__ */
|
|
6721
|
-
artifactCount > 0 && /* @__PURE__ */
|
|
6779
|
+
/* @__PURE__ */ import_react89.default.createElement(import_lucide_react18.Image, { className: "w-5 h-5", "aria-hidden": true }),
|
|
6780
|
+
artifactCount > 0 && /* @__PURE__ */ import_react89.default.createElement(
|
|
6722
6781
|
"span",
|
|
6723
6782
|
{
|
|
6724
6783
|
className: "absolute -top-1 -right-1 w-4 h-4 bg-gold text-obsidian text-xs font-medium flex items-center justify-center"
|
|
@@ -6730,7 +6789,7 @@ var ArtifactsPanelToggle = import_react88.default.forwardRef(({ artifactCount =
|
|
|
6730
6789
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
6731
6790
|
|
|
6732
6791
|
// src/components/chat/HistoryPanel.tsx
|
|
6733
|
-
var
|
|
6792
|
+
var import_react90 = __toESM(require("react"));
|
|
6734
6793
|
var import_lucide_react19 = require("lucide-react");
|
|
6735
6794
|
function parseTimestamp(ts) {
|
|
6736
6795
|
if (ts == null) {
|
|
@@ -6773,12 +6832,12 @@ function ProjectFilter({
|
|
|
6773
6832
|
onChange,
|
|
6774
6833
|
className
|
|
6775
6834
|
}) {
|
|
6776
|
-
const [open, setOpen] = (0,
|
|
6777
|
-
const ref = (0,
|
|
6778
|
-
const closeFilter = (0,
|
|
6835
|
+
const [open, setOpen] = (0, import_react90.useState)(false);
|
|
6836
|
+
const ref = (0, import_react90.useRef)(null);
|
|
6837
|
+
const closeFilter = (0, import_react90.useCallback)(() => setOpen(false), []);
|
|
6779
6838
|
useClickOutside(ref, closeFilter, open);
|
|
6780
6839
|
const label = value ?? "All projects";
|
|
6781
|
-
return /* @__PURE__ */
|
|
6840
|
+
return /* @__PURE__ */ import_react90.default.createElement("div", { className: cx("relative min-w-0", className), ref }, /* @__PURE__ */ import_react90.default.createElement(
|
|
6782
6841
|
"button",
|
|
6783
6842
|
{
|
|
6784
6843
|
type: "button",
|
|
@@ -6794,9 +6853,9 @@ function ProjectFilter({
|
|
|
6794
6853
|
"transition-colors duration-150 min-w-0"
|
|
6795
6854
|
)
|
|
6796
6855
|
},
|
|
6797
|
-
/* @__PURE__ */
|
|
6798
|
-
/* @__PURE__ */
|
|
6799
|
-
), open && /* @__PURE__ */
|
|
6856
|
+
/* @__PURE__ */ import_react90.default.createElement("span", { className: "truncate" }, label),
|
|
6857
|
+
/* @__PURE__ */ import_react90.default.createElement(import_lucide_react19.ChevronDown, { className: "w-3 h-3 shrink-0", "aria-hidden": true })
|
|
6858
|
+
), open && /* @__PURE__ */ import_react90.default.createElement(
|
|
6800
6859
|
"div",
|
|
6801
6860
|
{
|
|
6802
6861
|
role: "listbox",
|
|
@@ -6806,7 +6865,7 @@ function ProjectFilter({
|
|
|
6806
6865
|
"max-h-60 overflow-y-auto"
|
|
6807
6866
|
)
|
|
6808
6867
|
},
|
|
6809
|
-
/* @__PURE__ */
|
|
6868
|
+
/* @__PURE__ */ import_react90.default.createElement(
|
|
6810
6869
|
"button",
|
|
6811
6870
|
{
|
|
6812
6871
|
type: "button",
|
|
@@ -6824,7 +6883,7 @@ function ProjectFilter({
|
|
|
6824
6883
|
},
|
|
6825
6884
|
"All projects"
|
|
6826
6885
|
),
|
|
6827
|
-
projects.map((p) => /* @__PURE__ */
|
|
6886
|
+
projects.map((p) => /* @__PURE__ */ import_react90.default.createElement(
|
|
6828
6887
|
"button",
|
|
6829
6888
|
{
|
|
6830
6889
|
key: p,
|
|
@@ -6850,33 +6909,33 @@ function ConversationRow({
|
|
|
6850
6909
|
onSelect,
|
|
6851
6910
|
onRename
|
|
6852
6911
|
}) {
|
|
6853
|
-
const [isEditing, setIsEditing] = (0,
|
|
6854
|
-
const [draft, setDraft] = (0,
|
|
6855
|
-
const inputRef = (0,
|
|
6856
|
-
(0,
|
|
6912
|
+
const [isEditing, setIsEditing] = (0, import_react90.useState)(false);
|
|
6913
|
+
const [draft, setDraft] = (0, import_react90.useState)(conversation.title);
|
|
6914
|
+
const inputRef = (0, import_react90.useRef)(null);
|
|
6915
|
+
(0, import_react90.useEffect)(() => {
|
|
6857
6916
|
if (isEditing && inputRef.current) {
|
|
6858
6917
|
inputRef.current.focus();
|
|
6859
6918
|
inputRef.current.select();
|
|
6860
6919
|
}
|
|
6861
6920
|
}, [isEditing]);
|
|
6862
|
-
const startEdit = (0,
|
|
6921
|
+
const startEdit = (0, import_react90.useCallback)((e) => {
|
|
6863
6922
|
e.stopPropagation();
|
|
6864
6923
|
setDraft(conversation.title);
|
|
6865
6924
|
setIsEditing(true);
|
|
6866
6925
|
}, [conversation.title]);
|
|
6867
|
-
const commit = (0,
|
|
6926
|
+
const commit = (0, import_react90.useCallback)(() => {
|
|
6868
6927
|
const trimmed = draft.trim();
|
|
6869
6928
|
if (trimmed && trimmed !== conversation.title) {
|
|
6870
6929
|
onRename?.(conversation.id, trimmed);
|
|
6871
6930
|
}
|
|
6872
6931
|
setIsEditing(false);
|
|
6873
6932
|
}, [draft, conversation.id, conversation.title, onRename]);
|
|
6874
|
-
const cancel = (0,
|
|
6933
|
+
const cancel = (0, import_react90.useCallback)(() => {
|
|
6875
6934
|
setDraft(conversation.title);
|
|
6876
6935
|
setIsEditing(false);
|
|
6877
6936
|
}, [conversation.title]);
|
|
6878
6937
|
if (isEditing) {
|
|
6879
|
-
return /* @__PURE__ */
|
|
6938
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
6880
6939
|
"div",
|
|
6881
6940
|
{
|
|
6882
6941
|
className: cx(
|
|
@@ -6884,7 +6943,7 @@ function ConversationRow({
|
|
|
6884
6943
|
conversation.isActive ? "bg-ash/40" : "bg-ash/20"
|
|
6885
6944
|
)
|
|
6886
6945
|
},
|
|
6887
|
-
/* @__PURE__ */
|
|
6946
|
+
/* @__PURE__ */ import_react90.default.createElement(
|
|
6888
6947
|
"input",
|
|
6889
6948
|
{
|
|
6890
6949
|
ref: inputRef,
|
|
@@ -6909,10 +6968,10 @@ function ConversationRow({
|
|
|
6909
6968
|
"aria-label": "Conversation title"
|
|
6910
6969
|
}
|
|
6911
6970
|
),
|
|
6912
|
-
conversation.project && /* @__PURE__ */
|
|
6971
|
+
conversation.project && /* @__PURE__ */ import_react90.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-1" }, conversation.project)
|
|
6913
6972
|
);
|
|
6914
6973
|
}
|
|
6915
|
-
return /* @__PURE__ */
|
|
6974
|
+
return /* @__PURE__ */ import_react90.default.createElement("div", { className: "relative group" }, /* @__PURE__ */ import_react90.default.createElement(
|
|
6916
6975
|
"button",
|
|
6917
6976
|
{
|
|
6918
6977
|
onClick: () => onSelect?.(conversation.id),
|
|
@@ -6922,18 +6981,19 @@ function ConversationRow({
|
|
|
6922
6981
|
conversation.isActive ? "bg-ash/40 text-white" : "text-silver hover:bg-ash/20 hover:text-white"
|
|
6923
6982
|
)
|
|
6924
6983
|
},
|
|
6925
|
-
/* @__PURE__ */
|
|
6984
|
+
/* @__PURE__ */ import_react90.default.createElement(
|
|
6926
6985
|
"p",
|
|
6927
6986
|
{
|
|
6987
|
+
key: conversation.title,
|
|
6928
6988
|
className: cx(
|
|
6929
|
-
"text-sm font-medium truncate",
|
|
6989
|
+
"text-sm font-medium truncate animate-fade-in",
|
|
6930
6990
|
onRename ? "pr-6" : ""
|
|
6931
6991
|
)
|
|
6932
6992
|
},
|
|
6933
6993
|
conversation.title
|
|
6934
6994
|
),
|
|
6935
|
-
conversation.project && /* @__PURE__ */
|
|
6936
|
-
), onRename && /* @__PURE__ */
|
|
6995
|
+
conversation.project && /* @__PURE__ */ import_react90.default.createElement("p", { className: "text-xs text-silver/60 truncate mt-0.5" }, conversation.project)
|
|
6996
|
+
), onRename && /* @__PURE__ */ import_react90.default.createElement(
|
|
6937
6997
|
"button",
|
|
6938
6998
|
{
|
|
6939
6999
|
type: "button",
|
|
@@ -6946,7 +7006,7 @@ function ConversationRow({
|
|
|
6946
7006
|
"transition-opacity duration-150"
|
|
6947
7007
|
)
|
|
6948
7008
|
},
|
|
6949
|
-
/* @__PURE__ */
|
|
7009
|
+
/* @__PURE__ */ import_react90.default.createElement(import_lucide_react19.Pencil, { className: "w-3.5 h-3.5", "aria-hidden": true })
|
|
6950
7010
|
));
|
|
6951
7011
|
}
|
|
6952
7012
|
function HistoryPanel({
|
|
@@ -6955,8 +7015,8 @@ function HistoryPanel({
|
|
|
6955
7015
|
onNewChat,
|
|
6956
7016
|
onRenameConversation
|
|
6957
7017
|
}) {
|
|
6958
|
-
const [projectFilter, setProjectFilter] = (0,
|
|
6959
|
-
const projects = (0,
|
|
7018
|
+
const [projectFilter, setProjectFilter] = (0, import_react90.useState)(null);
|
|
7019
|
+
const projects = (0, import_react90.useMemo)(() => {
|
|
6960
7020
|
const set = /* @__PURE__ */ new Set();
|
|
6961
7021
|
for (const c of conversations) {
|
|
6962
7022
|
if (c.project) {
|
|
@@ -6965,23 +7025,23 @@ function HistoryPanel({
|
|
|
6965
7025
|
}
|
|
6966
7026
|
return Array.from(set).sort((a, b) => a.localeCompare(b));
|
|
6967
7027
|
}, [conversations]);
|
|
6968
|
-
(0,
|
|
7028
|
+
(0, import_react90.useEffect)(() => {
|
|
6969
7029
|
if (projectFilter && !projects.includes(projectFilter)) {
|
|
6970
7030
|
setProjectFilter(null);
|
|
6971
7031
|
}
|
|
6972
7032
|
}, [projects, projectFilter]);
|
|
6973
|
-
const filteredConversations = (0,
|
|
7033
|
+
const filteredConversations = (0, import_react90.useMemo)(() => {
|
|
6974
7034
|
if (!projectFilter) {
|
|
6975
7035
|
return conversations;
|
|
6976
7036
|
}
|
|
6977
7037
|
return conversations.filter((c) => c.project === projectFilter);
|
|
6978
7038
|
}, [conversations, projectFilter]);
|
|
6979
|
-
const groups = (0,
|
|
7039
|
+
const groups = (0, import_react90.useMemo)(
|
|
6980
7040
|
() => groupConversations(filteredConversations),
|
|
6981
7041
|
[filteredConversations]
|
|
6982
7042
|
);
|
|
6983
7043
|
const hasFilter = projects.length > 0;
|
|
6984
|
-
return /* @__PURE__ */
|
|
7044
|
+
return /* @__PURE__ */ import_react90.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react90.default.createElement("div", { className: "px-4 py-3 border-b border-ash/40 shrink-0 flex items-center gap-2" }, /* @__PURE__ */ import_react90.default.createElement("h3", { className: "text-xs font-medium text-white shrink-0" }, "History"), (hasFilter || onNewChat) && /* @__PURE__ */ import_react90.default.createElement("div", { className: "flex items-center gap-2 flex-1 min-w-0" }, hasFilter && /* @__PURE__ */ import_react90.default.createElement(import_react90.default.Fragment, null, /* @__PURE__ */ import_react90.default.createElement("div", { className: "w-px h-3 bg-ash/40 shrink-0 mx-1" }), /* @__PURE__ */ import_react90.default.createElement(
|
|
6985
7045
|
ProjectFilter,
|
|
6986
7046
|
{
|
|
6987
7047
|
projects,
|
|
@@ -6989,7 +7049,7 @@ function HistoryPanel({
|
|
|
6989
7049
|
onChange: setProjectFilter,
|
|
6990
7050
|
className: "flex-1"
|
|
6991
7051
|
}
|
|
6992
|
-
)), onNewChat && /* @__PURE__ */
|
|
7052
|
+
)), onNewChat && /* @__PURE__ */ import_react90.default.createElement(import_react90.default.Fragment, null, /* @__PURE__ */ import_react90.default.createElement("div", { className: "w-px h-3 bg-ash/40 shrink-0 mx-1" }), /* @__PURE__ */ import_react90.default.createElement(
|
|
6993
7053
|
"button",
|
|
6994
7054
|
{
|
|
6995
7055
|
onClick: onNewChat,
|
|
@@ -7001,15 +7061,15 @@ function HistoryPanel({
|
|
|
7001
7061
|
"transition-colors duration-200"
|
|
7002
7062
|
)
|
|
7003
7063
|
},
|
|
7004
|
-
/* @__PURE__ */
|
|
7005
|
-
/* @__PURE__ */
|
|
7006
|
-
)))), /* @__PURE__ */
|
|
7064
|
+
/* @__PURE__ */ import_react90.default.createElement(PlusIcon, { className: "w-4 h-4" }),
|
|
7065
|
+
/* @__PURE__ */ import_react90.default.createElement("span", { className: "truncate" }, "New Chat")
|
|
7066
|
+
)))), /* @__PURE__ */ import_react90.default.createElement("div", { className: "flex-1 overflow-y-auto py-2" }, conversations.length === 0 ? /* @__PURE__ */ import_react90.default.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations yet") : groups.length === 0 ? /* @__PURE__ */ import_react90.default.createElement("p", { className: "px-4 py-2 text-xs text-silver/60" }, "No conversations match this filter") : /* @__PURE__ */ import_react90.default.createElement("div", null, groups.map((group, index) => /* @__PURE__ */ import_react90.default.createElement("section", { key: group.key, className: cx(index > 0 && "mt-3") }, /* @__PURE__ */ import_react90.default.createElement("div", { className: "flex items-center gap-2 px-3 pb-2" }, /* @__PURE__ */ import_react90.default.createElement(
|
|
7007
7067
|
"span",
|
|
7008
7068
|
{
|
|
7009
7069
|
className: "text-xs font-medium uppercase tracking-wider text-gold/70"
|
|
7010
7070
|
},
|
|
7011
7071
|
group.label
|
|
7012
|
-
), /* @__PURE__ */
|
|
7072
|
+
), /* @__PURE__ */ import_react90.default.createElement("div", { className: "flex-1 h-px bg-gold/20" })), /* @__PURE__ */ import_react90.default.createElement("div", { className: "space-y-1 px-2" }, group.conversations.map((conversation) => /* @__PURE__ */ import_react90.default.createElement(
|
|
7013
7073
|
ConversationRow,
|
|
7014
7074
|
{
|
|
7015
7075
|
key: conversation.id,
|
|
@@ -7021,7 +7081,7 @@ function HistoryPanel({
|
|
|
7021
7081
|
}
|
|
7022
7082
|
|
|
7023
7083
|
// src/components/chat/TodosList.tsx
|
|
7024
|
-
var
|
|
7084
|
+
var import_react91 = __toESM(require("react"));
|
|
7025
7085
|
var import_lucide_react20 = require("lucide-react");
|
|
7026
7086
|
var TASK_STATUSES = {
|
|
7027
7087
|
PENDING: "pending",
|
|
@@ -7033,16 +7093,16 @@ var TASK_STATUSES = {
|
|
|
7033
7093
|
function TaskIcon({ status }) {
|
|
7034
7094
|
switch (status) {
|
|
7035
7095
|
case "done":
|
|
7036
|
-
return /* @__PURE__ */
|
|
7096
|
+
return /* @__PURE__ */ import_react91.default.createElement(CheckSquareIcon, null);
|
|
7037
7097
|
case "in_progress":
|
|
7038
|
-
return /* @__PURE__ */
|
|
7098
|
+
return /* @__PURE__ */ import_react91.default.createElement(SquareLoaderIcon, null);
|
|
7039
7099
|
case "cancelled":
|
|
7040
|
-
return /* @__PURE__ */
|
|
7100
|
+
return /* @__PURE__ */ import_react91.default.createElement(CrossSquareIcon, { variant: "cancelled" });
|
|
7041
7101
|
case "failed":
|
|
7042
|
-
return /* @__PURE__ */
|
|
7102
|
+
return /* @__PURE__ */ import_react91.default.createElement(CrossSquareIcon, { variant: "failed" });
|
|
7043
7103
|
case "pending":
|
|
7044
7104
|
default:
|
|
7045
|
-
return /* @__PURE__ */
|
|
7105
|
+
return /* @__PURE__ */ import_react91.default.createElement(EmptySquareIcon, null);
|
|
7046
7106
|
}
|
|
7047
7107
|
}
|
|
7048
7108
|
function sortTasks(tasks) {
|
|
@@ -7062,14 +7122,14 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
7062
7122
|
const isSubtle = task.status === "cancelled" || task.status === "failed";
|
|
7063
7123
|
const showSubtasks = task.subtasks && task.subtasks.length > 0;
|
|
7064
7124
|
const sortedSubtasks = showSubtasks ? sortTasks(task.subtasks) : [];
|
|
7065
|
-
return /* @__PURE__ */
|
|
7125
|
+
return /* @__PURE__ */ import_react91.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react91.default.createElement(
|
|
7066
7126
|
"div",
|
|
7067
7127
|
{
|
|
7068
7128
|
className: "flex items-center gap-2 py-1",
|
|
7069
7129
|
style: { paddingLeft: `${depth * 1.5}rem` }
|
|
7070
7130
|
},
|
|
7071
|
-
/* @__PURE__ */
|
|
7072
|
-
/* @__PURE__ */
|
|
7131
|
+
/* @__PURE__ */ import_react91.default.createElement(TaskIcon, { status: task.status }),
|
|
7132
|
+
/* @__PURE__ */ import_react91.default.createElement(
|
|
7073
7133
|
"span",
|
|
7074
7134
|
{
|
|
7075
7135
|
className: cx(
|
|
@@ -7081,10 +7141,10 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
7081
7141
|
)
|
|
7082
7142
|
},
|
|
7083
7143
|
task.label,
|
|
7084
|
-
task.status === "cancelled" && /* @__PURE__ */
|
|
7085
|
-
task.status === "failed" && /* @__PURE__ */
|
|
7144
|
+
task.status === "cancelled" && /* @__PURE__ */ import_react91.default.createElement("span", { className: "text-silver/40 ml-1" }, "(cancelled)"),
|
|
7145
|
+
task.status === "failed" && /* @__PURE__ */ import_react91.default.createElement("span", { className: "text-error/60 ml-1" }, "(failed)")
|
|
7086
7146
|
)
|
|
7087
|
-
), showSubtasks && /* @__PURE__ */
|
|
7147
|
+
), showSubtasks && /* @__PURE__ */ import_react91.default.createElement("div", { className: "flex flex-col" }, sortedSubtasks.map((subtask) => /* @__PURE__ */ import_react91.default.createElement(TaskItem, { key: subtask.id, task: subtask, depth: depth + 1 }))));
|
|
7088
7148
|
}
|
|
7089
7149
|
function hasInProgressTask(tasks) {
|
|
7090
7150
|
return tasks.some((t) => {
|
|
@@ -7097,11 +7157,11 @@ function hasInProgressTask(tasks) {
|
|
|
7097
7157
|
return false;
|
|
7098
7158
|
});
|
|
7099
7159
|
}
|
|
7100
|
-
var TodosList =
|
|
7160
|
+
var TodosList = import_react91.default.forwardRef(
|
|
7101
7161
|
({ tasks, title = "Tasks", onStopAllTasks, className, ...rest }, ref) => {
|
|
7102
|
-
const sortedTasks = (0,
|
|
7103
|
-
const [isStopping, setIsStopping] = (0,
|
|
7104
|
-
const handleStopClick = (0,
|
|
7162
|
+
const sortedTasks = (0, import_react91.useMemo)(() => sortTasks(tasks), [tasks]);
|
|
7163
|
+
const [isStopping, setIsStopping] = (0, import_react91.useState)(false);
|
|
7164
|
+
const handleStopClick = (0, import_react91.useCallback)(async () => {
|
|
7105
7165
|
if (!onStopAllTasks || isStopping) {
|
|
7106
7166
|
return;
|
|
7107
7167
|
}
|
|
@@ -7122,7 +7182,7 @@ var TodosList = import_react90.default.forwardRef(
|
|
|
7122
7182
|
if (tasks.length === 0) {
|
|
7123
7183
|
return null;
|
|
7124
7184
|
}
|
|
7125
|
-
return /* @__PURE__ */
|
|
7185
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
7126
7186
|
"div",
|
|
7127
7187
|
{
|
|
7128
7188
|
ref,
|
|
@@ -7133,16 +7193,16 @@ var TodosList = import_react90.default.forwardRef(
|
|
|
7133
7193
|
),
|
|
7134
7194
|
...rest
|
|
7135
7195
|
},
|
|
7136
|
-
/* @__PURE__ */
|
|
7196
|
+
/* @__PURE__ */ import_react91.default.createElement(
|
|
7137
7197
|
"div",
|
|
7138
7198
|
{
|
|
7139
7199
|
className: "flex items-center justify-between px-4 py-2 border-b border-ash/40 flex-shrink-0"
|
|
7140
7200
|
},
|
|
7141
|
-
/* @__PURE__ */
|
|
7142
|
-
/* @__PURE__ */
|
|
7201
|
+
/* @__PURE__ */ import_react91.default.createElement("h4", { className: "text-xs font-medium text-white" }, title),
|
|
7202
|
+
/* @__PURE__ */ import_react91.default.createElement("span", { className: "text-xs text-silver/60" }, countCompleted(tasks), "/", countTotal(tasks))
|
|
7143
7203
|
),
|
|
7144
|
-
/* @__PURE__ */
|
|
7145
|
-
showStopButton && /* @__PURE__ */
|
|
7204
|
+
/* @__PURE__ */ import_react91.default.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-2" }, sortedTasks.map((task) => /* @__PURE__ */ import_react91.default.createElement(TaskItem, { key: task.id, task }))),
|
|
7205
|
+
showStopButton && /* @__PURE__ */ import_react91.default.createElement("div", { className: "px-4 py-2 border-t border-ash/40 flex-shrink-0" }, /* @__PURE__ */ import_react91.default.createElement(
|
|
7146
7206
|
"button",
|
|
7147
7207
|
{
|
|
7148
7208
|
type: "button",
|
|
@@ -7159,7 +7219,7 @@ var TodosList = import_react90.default.forwardRef(
|
|
|
7159
7219
|
isStopping ? "cursor-not-allowed opacity-70" : "hover:bg-error/20"
|
|
7160
7220
|
)
|
|
7161
7221
|
},
|
|
7162
|
-
isStopping ? /* @__PURE__ */
|
|
7222
|
+
isStopping ? /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, /* @__PURE__ */ import_react91.default.createElement(import_lucide_react20.Loader2, { className: "w-3 h-3 animate-spin" }), "Stopping tasks") : /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, /* @__PURE__ */ import_react91.default.createElement(import_lucide_react20.Square, { className: "w-3 h-3 fill-current" }), "Stop All Tasks")
|
|
7163
7223
|
))
|
|
7164
7224
|
);
|
|
7165
7225
|
}
|
|
@@ -7179,8 +7239,8 @@ function areAllTasksSettled(tasks) {
|
|
|
7179
7239
|
}
|
|
7180
7240
|
|
|
7181
7241
|
// src/components/chat/ToolSidebar.tsx
|
|
7182
|
-
var
|
|
7183
|
-
var ToolSidebar =
|
|
7242
|
+
var import_react92 = __toESM(require("react"));
|
|
7243
|
+
var ToolSidebar = import_react92.default.forwardRef(
|
|
7184
7244
|
({ tools, activeTools, onToggleTool, side, className, ...rest }, ref) => {
|
|
7185
7245
|
const topTools = tools.filter((t) => t.group === `top-${side}`);
|
|
7186
7246
|
const bottomTools = tools.filter((t) => t.group === `bottom-${side}`);
|
|
@@ -7191,7 +7251,7 @@ var ToolSidebar = import_react91.default.forwardRef(
|
|
|
7191
7251
|
};
|
|
7192
7252
|
const renderButton = (tool) => {
|
|
7193
7253
|
const active = isActive(tool.id);
|
|
7194
|
-
return /* @__PURE__ */
|
|
7254
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
7195
7255
|
"button",
|
|
7196
7256
|
{
|
|
7197
7257
|
key: tool.id,
|
|
@@ -7203,10 +7263,10 @@ var ToolSidebar = import_react91.default.forwardRef(
|
|
|
7203
7263
|
"aria-label": tool.label,
|
|
7204
7264
|
"aria-pressed": active
|
|
7205
7265
|
},
|
|
7206
|
-
/* @__PURE__ */
|
|
7266
|
+
/* @__PURE__ */ import_react92.default.createElement("span", { className: "w-4 h-4 block" }, tool.icon)
|
|
7207
7267
|
);
|
|
7208
7268
|
};
|
|
7209
|
-
return /* @__PURE__ */
|
|
7269
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
7210
7270
|
"div",
|
|
7211
7271
|
{
|
|
7212
7272
|
ref,
|
|
@@ -7217,17 +7277,17 @@ var ToolSidebar = import_react91.default.forwardRef(
|
|
|
7217
7277
|
),
|
|
7218
7278
|
...rest
|
|
7219
7279
|
},
|
|
7220
|
-
/* @__PURE__ */
|
|
7221
|
-
/* @__PURE__ */
|
|
7222
|
-
/* @__PURE__ */
|
|
7280
|
+
/* @__PURE__ */ import_react92.default.createElement("div", { className: "flex flex-col items-center gap-1" }, topTools.map(renderButton)),
|
|
7281
|
+
/* @__PURE__ */ import_react92.default.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "w-5 border-t border-ash/30" })),
|
|
7282
|
+
/* @__PURE__ */ import_react92.default.createElement("div", { className: "flex flex-col items-center gap-1" }, bottomTools.map(renderButton))
|
|
7223
7283
|
);
|
|
7224
7284
|
}
|
|
7225
7285
|
);
|
|
7226
7286
|
ToolSidebar.displayName = "ToolSidebar";
|
|
7227
7287
|
|
|
7228
7288
|
// src/components/chat/ToolPanelContainer.tsx
|
|
7229
|
-
var
|
|
7230
|
-
var ToolPanelContainer =
|
|
7289
|
+
var import_react93 = __toESM(require("react"));
|
|
7290
|
+
var ToolPanelContainer = import_react93.default.forwardRef(
|
|
7231
7291
|
({
|
|
7232
7292
|
topContent,
|
|
7233
7293
|
bottomContent,
|
|
@@ -7238,21 +7298,21 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7238
7298
|
initialTopPercent = 60,
|
|
7239
7299
|
...rest
|
|
7240
7300
|
}, ref) => {
|
|
7241
|
-
const [topPercent, setTopPercent] = (0,
|
|
7242
|
-
const [isResizingHeight, setIsResizingHeight] = (0,
|
|
7243
|
-
const containerRef = (0,
|
|
7244
|
-
const lastY = (0,
|
|
7301
|
+
const [topPercent, setTopPercent] = (0, import_react93.useState)(initialTopPercent);
|
|
7302
|
+
const [isResizingHeight, setIsResizingHeight] = (0, import_react93.useState)(false);
|
|
7303
|
+
const containerRef = (0, import_react93.useRef)(null);
|
|
7304
|
+
const lastY = (0, import_react93.useRef)(null);
|
|
7245
7305
|
const hasBoth = topContent !== null && bottomContent !== null;
|
|
7246
|
-
const startHeightResize = (0,
|
|
7306
|
+
const startHeightResize = (0, import_react93.useCallback)((e) => {
|
|
7247
7307
|
e.preventDefault();
|
|
7248
7308
|
setIsResizingHeight(true);
|
|
7249
7309
|
lastY.current = e.clientY;
|
|
7250
7310
|
}, []);
|
|
7251
|
-
const stopHeightResize = (0,
|
|
7311
|
+
const stopHeightResize = (0, import_react93.useCallback)(() => {
|
|
7252
7312
|
setIsResizingHeight(false);
|
|
7253
7313
|
lastY.current = null;
|
|
7254
7314
|
}, []);
|
|
7255
|
-
const resizeHeight = (0,
|
|
7315
|
+
const resizeHeight = (0, import_react93.useCallback)(
|
|
7256
7316
|
(e) => {
|
|
7257
7317
|
if (!isResizingHeight || lastY.current === null || !containerRef.current) {
|
|
7258
7318
|
return;
|
|
@@ -7271,7 +7331,7 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7271
7331
|
},
|
|
7272
7332
|
[isResizingHeight]
|
|
7273
7333
|
);
|
|
7274
|
-
(0,
|
|
7334
|
+
(0, import_react93.useEffect)(() => {
|
|
7275
7335
|
if (isResizingHeight) {
|
|
7276
7336
|
window.addEventListener("mousemove", resizeHeight);
|
|
7277
7337
|
window.addEventListener("mouseup", stopHeightResize);
|
|
@@ -7290,7 +7350,7 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7290
7350
|
document.body.style.userSelect = "";
|
|
7291
7351
|
};
|
|
7292
7352
|
}, [isResizingHeight, resizeHeight, stopHeightResize]);
|
|
7293
|
-
return /* @__PURE__ */
|
|
7353
|
+
return /* @__PURE__ */ import_react93.default.createElement(
|
|
7294
7354
|
"div",
|
|
7295
7355
|
{
|
|
7296
7356
|
ref: composeRefs(containerRef, ref),
|
|
@@ -7302,7 +7362,7 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7302
7362
|
style: width ? { width } : void 0,
|
|
7303
7363
|
...rest
|
|
7304
7364
|
},
|
|
7305
|
-
/* @__PURE__ */
|
|
7365
|
+
/* @__PURE__ */ import_react93.default.createElement(
|
|
7306
7366
|
"div",
|
|
7307
7367
|
{
|
|
7308
7368
|
onMouseDown: onResizeStart,
|
|
@@ -7313,7 +7373,7 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7313
7373
|
)
|
|
7314
7374
|
}
|
|
7315
7375
|
),
|
|
7316
|
-
topContent !== null && /* @__PURE__ */
|
|
7376
|
+
topContent !== null && /* @__PURE__ */ import_react93.default.createElement(
|
|
7317
7377
|
"div",
|
|
7318
7378
|
{
|
|
7319
7379
|
className: "min-h-0 overflow-hidden flex flex-col",
|
|
@@ -7321,7 +7381,7 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7321
7381
|
},
|
|
7322
7382
|
topContent
|
|
7323
7383
|
),
|
|
7324
|
-
hasBoth && /* @__PURE__ */
|
|
7384
|
+
hasBoth && /* @__PURE__ */ import_react93.default.createElement(
|
|
7325
7385
|
"div",
|
|
7326
7386
|
{
|
|
7327
7387
|
onMouseDown: startHeightResize,
|
|
@@ -7333,7 +7393,7 @@ var ToolPanelContainer = import_react92.default.forwardRef(
|
|
|
7333
7393
|
)
|
|
7334
7394
|
}
|
|
7335
7395
|
),
|
|
7336
|
-
bottomContent !== null && /* @__PURE__ */
|
|
7396
|
+
bottomContent !== null && /* @__PURE__ */ import_react93.default.createElement(
|
|
7337
7397
|
"div",
|
|
7338
7398
|
{
|
|
7339
7399
|
className: "min-h-0 overflow-hidden flex flex-col",
|
|
@@ -7493,7 +7553,7 @@ function isAncestor(tree, ancestorId, descendantId) {
|
|
|
7493
7553
|
}
|
|
7494
7554
|
|
|
7495
7555
|
// src/components/chat/ChatInterface.tsx
|
|
7496
|
-
var ChatInterface =
|
|
7556
|
+
var ChatInterface = import_react94.default.forwardRef(
|
|
7497
7557
|
({
|
|
7498
7558
|
messages = [],
|
|
7499
7559
|
conversationTree,
|
|
@@ -7534,20 +7594,23 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7534
7594
|
autoFocus = true,
|
|
7535
7595
|
textareaRef,
|
|
7536
7596
|
onTextareaKeyDown,
|
|
7597
|
+
chatLoading = false,
|
|
7598
|
+
artifactsLoading = false,
|
|
7599
|
+
inputDisabled = false,
|
|
7537
7600
|
className,
|
|
7538
7601
|
...rest
|
|
7539
7602
|
}, ref) => {
|
|
7540
|
-
const prevArtifactNodesRef = (0,
|
|
7541
|
-
const prevTasksRef = (0,
|
|
7542
|
-
const [panelOpenArtifactId, setPanelOpenArtifactId] = (0,
|
|
7543
|
-
const [internalTools, setInternalTools] = (0,
|
|
7603
|
+
const prevArtifactNodesRef = (0, import_react94.useRef)([]);
|
|
7604
|
+
const prevTasksRef = (0, import_react94.useRef)([]);
|
|
7605
|
+
const [panelOpenArtifactId, setPanelOpenArtifactId] = (0, import_react94.useState)(null);
|
|
7606
|
+
const [internalTools, setInternalTools] = (0, import_react94.useState)({
|
|
7544
7607
|
"top-left": "history",
|
|
7545
7608
|
"bottom-left": null,
|
|
7546
7609
|
"top-right": null,
|
|
7547
7610
|
"bottom-right": null
|
|
7548
7611
|
});
|
|
7549
|
-
const dismissedToolsRef = (0,
|
|
7550
|
-
const openArtifact = (0,
|
|
7612
|
+
const dismissedToolsRef = (0, import_react94.useRef)(/* @__PURE__ */ new Set());
|
|
7613
|
+
const openArtifact = (0, import_react94.useCallback)((artifactId) => {
|
|
7551
7614
|
dismissedToolsRef.current.delete("artifacts");
|
|
7552
7615
|
if (isArtifactsPanelOpen === void 0) {
|
|
7553
7616
|
setInternalTools((prev) => prev["top-right"] === "artifacts" ? prev : { ...prev, "top-right": "artifacts" });
|
|
@@ -7556,16 +7619,16 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7556
7619
|
}
|
|
7557
7620
|
setPanelOpenArtifactId(artifactId);
|
|
7558
7621
|
}, [isArtifactsPanelOpen, onArtifactsPanelOpenChange]);
|
|
7559
|
-
const handleAttachmentOpen = (0,
|
|
7622
|
+
const handleAttachmentOpen = (0, import_react94.useCallback)((artifactId) => {
|
|
7560
7623
|
openArtifact(artifactId);
|
|
7561
7624
|
onAttachmentOpen?.(artifactId);
|
|
7562
7625
|
}, [openArtifact, onAttachmentOpen]);
|
|
7563
|
-
const handleArtifactPanelClosed = (0,
|
|
7626
|
+
const handleArtifactPanelClosed = (0, import_react94.useCallback)(() => {
|
|
7564
7627
|
setPanelOpenArtifactId(null);
|
|
7565
7628
|
}, []);
|
|
7566
|
-
(0,
|
|
7629
|
+
(0, import_react94.useImperativeHandle)(ref, () => ({ openArtifact }), [openArtifact]);
|
|
7567
7630
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
7568
|
-
const activeTools = (0,
|
|
7631
|
+
const activeTools = (0, import_react94.useMemo)(() => {
|
|
7569
7632
|
if (isPanelControlled) {
|
|
7570
7633
|
return {
|
|
7571
7634
|
...internalTools,
|
|
@@ -7595,13 +7658,13 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7595
7658
|
direction: "right"
|
|
7596
7659
|
});
|
|
7597
7660
|
const allSettled = tasks.length === 0 || areAllTasksSettled(tasks);
|
|
7598
|
-
const allToolDefinitions = (0,
|
|
7661
|
+
const allToolDefinitions = (0, import_react94.useMemo)(() => {
|
|
7599
7662
|
const builtIn = [
|
|
7600
|
-
{ id: "history", icon: /* @__PURE__ */
|
|
7601
|
-
{ id: "artifacts", icon: /* @__PURE__ */
|
|
7663
|
+
{ id: "history", icon: /* @__PURE__ */ import_react94.default.createElement(ChatBubbleIcon, null), label: "History", group: "top-left" },
|
|
7664
|
+
{ id: "artifacts", icon: /* @__PURE__ */ import_react94.default.createElement(MediaIcon, null), label: "Artifacts", group: "top-right" },
|
|
7602
7665
|
{
|
|
7603
7666
|
id: "todos",
|
|
7604
|
-
icon: allSettled ? /* @__PURE__ */
|
|
7667
|
+
icon: allSettled ? /* @__PURE__ */ import_react94.default.createElement(CheckSquareIcon, null) : /* @__PURE__ */ import_react94.default.createElement(SquareLoaderIcon, null),
|
|
7605
7668
|
label: "Tasks",
|
|
7606
7669
|
group: "bottom-right"
|
|
7607
7670
|
}
|
|
@@ -7609,7 +7672,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7609
7672
|
const external = externalTools.map(({ content: _content, ...def }) => def);
|
|
7610
7673
|
return [...builtIn, ...external];
|
|
7611
7674
|
}, [allSettled, externalTools]);
|
|
7612
|
-
const toggleTool = (0,
|
|
7675
|
+
const toggleTool = (0, import_react94.useCallback)((toolId) => {
|
|
7613
7676
|
const toolDef = allToolDefinitions.find((t) => t.id === toolId);
|
|
7614
7677
|
if (!toolDef) {
|
|
7615
7678
|
return;
|
|
@@ -7640,15 +7703,15 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7640
7703
|
}, [allToolDefinitions, isPanelControlled, activeTools, onArtifactsPanelOpenChange]);
|
|
7641
7704
|
const isTreeMode = !!conversationTree;
|
|
7642
7705
|
const tree = isTreeMode ? conversationTree : null;
|
|
7643
|
-
const activePath = (0,
|
|
7706
|
+
const activePath = (0, import_react94.useMemo)(() => {
|
|
7644
7707
|
if (tree) return getActivePath(tree);
|
|
7645
7708
|
return (messages || []).map((m) => ({ ...m, children: [], branchIndex: 0 }));
|
|
7646
7709
|
}, [tree, messages]);
|
|
7647
|
-
const greyedFuture = (0,
|
|
7710
|
+
const greyedFuture = (0, import_react94.useMemo)(
|
|
7648
7711
|
() => tree ? getGreyedFuture(tree) : [],
|
|
7649
7712
|
[tree]
|
|
7650
7713
|
);
|
|
7651
|
-
const activeCheckpointId = (0,
|
|
7714
|
+
const activeCheckpointId = (0, import_react94.useMemo)(() => {
|
|
7652
7715
|
if (!tree) return null;
|
|
7653
7716
|
const found = findAncestor(
|
|
7654
7717
|
tree,
|
|
@@ -7657,7 +7720,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7657
7720
|
);
|
|
7658
7721
|
return found?.id ?? null;
|
|
7659
7722
|
}, [tree]);
|
|
7660
|
-
(0,
|
|
7723
|
+
(0, import_react94.useEffect)(() => {
|
|
7661
7724
|
const nodes = artifactNodes || [];
|
|
7662
7725
|
const prevNodes = prevArtifactNodesRef.current;
|
|
7663
7726
|
const hasNewOrChangedNode = nodes.length !== prevNodes.length || nodes.some((n, i) => n.id !== prevNodes[i]?.id);
|
|
@@ -7682,7 +7745,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7682
7745
|
prevArtifactNodesRef.current = nodes;
|
|
7683
7746
|
prevTasksRef.current = tasks;
|
|
7684
7747
|
}, [artifactNodes, tasks, isPanelControlled]);
|
|
7685
|
-
const handleBranchSwitch = (0,
|
|
7748
|
+
const handleBranchSwitch = (0, import_react94.useCallback)(
|
|
7686
7749
|
(nodeId, direction) => {
|
|
7687
7750
|
if (!tree || !onTreeChange) {
|
|
7688
7751
|
return;
|
|
@@ -7691,7 +7754,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7691
7754
|
},
|
|
7692
7755
|
[tree, onTreeChange]
|
|
7693
7756
|
);
|
|
7694
|
-
const handleJumpHere = (0,
|
|
7757
|
+
const handleJumpHere = (0, import_react94.useCallback)((nodeId) => {
|
|
7695
7758
|
if (!tree) return;
|
|
7696
7759
|
if (onJumpHere) {
|
|
7697
7760
|
onJumpHere(nodeId);
|
|
@@ -7701,7 +7764,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7701
7764
|
onTreeChange(setActiveLeaf(tree, nodeId));
|
|
7702
7765
|
}
|
|
7703
7766
|
}, [tree, onTreeChange, onJumpHere]);
|
|
7704
|
-
const handleJumpToLatest = (0,
|
|
7767
|
+
const handleJumpToLatest = (0, import_react94.useCallback)(() => {
|
|
7705
7768
|
if (!tree) return;
|
|
7706
7769
|
if (onJumpToLatest) {
|
|
7707
7770
|
onJumpToLatest();
|
|
@@ -7711,7 +7774,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7711
7774
|
onTreeChange(setActiveLeaf(tree, tree.lastLeafId));
|
|
7712
7775
|
}
|
|
7713
7776
|
}, [tree, onTreeChange, onJumpToLatest]);
|
|
7714
|
-
const buildItem = (0,
|
|
7777
|
+
const buildItem = (0, import_react94.useCallback)(
|
|
7715
7778
|
(node, opts) => {
|
|
7716
7779
|
const branchInfo = tree && getSiblingInfo(tree, node.id).total > 1 ? {
|
|
7717
7780
|
...getSiblingInfo(tree, node.id),
|
|
@@ -7769,7 +7832,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7769
7832
|
handleAttachmentOpen
|
|
7770
7833
|
]
|
|
7771
7834
|
);
|
|
7772
|
-
const displayItems = (0,
|
|
7835
|
+
const displayItems = (0, import_react94.useMemo)(() => {
|
|
7773
7836
|
const items = activePath.map((n) => buildItem(n, { muted: false }));
|
|
7774
7837
|
if (greyedFuture.length > 0) {
|
|
7775
7838
|
const messageCount = greyedFuture.filter((n) => n.kind === "message").length;
|
|
@@ -7787,7 +7850,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7787
7850
|
}
|
|
7788
7851
|
return items;
|
|
7789
7852
|
}, [activePath, greyedFuture, buildItem, handleJumpToLatest]);
|
|
7790
|
-
const latestUserMessageIndex = (0,
|
|
7853
|
+
const latestUserMessageIndex = (0, import_react94.useMemo)(() => {
|
|
7791
7854
|
for (let i = displayItems.length - 1; i >= 0; i--) {
|
|
7792
7855
|
const item = displayItems[i];
|
|
7793
7856
|
if (item.kind === "message" && item.variant === "user" && !item.muted) {
|
|
@@ -7796,18 +7859,18 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7796
7859
|
}
|
|
7797
7860
|
return -1;
|
|
7798
7861
|
}, [displayItems]);
|
|
7799
|
-
const handleSubmit = (0,
|
|
7862
|
+
const handleSubmit = (0, import_react94.useCallback)(
|
|
7800
7863
|
(message, attachments) => {
|
|
7801
7864
|
onMessageSubmit?.(message, attachments);
|
|
7802
7865
|
},
|
|
7803
7866
|
[onMessageSubmit]
|
|
7804
7867
|
);
|
|
7805
|
-
const isEmpty = displayItems.length === 0;
|
|
7806
|
-
const leftToolDefs = (0,
|
|
7868
|
+
const isEmpty = displayItems.length === 0 && !chatLoading;
|
|
7869
|
+
const leftToolDefs = (0, import_react94.useMemo)(
|
|
7807
7870
|
() => allToolDefinitions.filter((t) => t.group === "top-left" || t.group === "bottom-left"),
|
|
7808
7871
|
[allToolDefinitions]
|
|
7809
7872
|
);
|
|
7810
|
-
const rightToolDefs = (0,
|
|
7873
|
+
const rightToolDefs = (0, import_react94.useMemo)(
|
|
7811
7874
|
() => allToolDefinitions.filter(
|
|
7812
7875
|
(t) => t.group === "top-right" || t.group === "bottom-right"
|
|
7813
7876
|
),
|
|
@@ -7821,7 +7884,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7821
7884
|
}
|
|
7822
7885
|
switch (toolId) {
|
|
7823
7886
|
case "history":
|
|
7824
|
-
return /* @__PURE__ */
|
|
7887
|
+
return /* @__PURE__ */ import_react94.default.createElement(
|
|
7825
7888
|
HistoryPanel,
|
|
7826
7889
|
{
|
|
7827
7890
|
conversations,
|
|
@@ -7831,10 +7894,11 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7831
7894
|
}
|
|
7832
7895
|
);
|
|
7833
7896
|
case "artifacts":
|
|
7834
|
-
return /* @__PURE__ */
|
|
7897
|
+
return /* @__PURE__ */ import_react94.default.createElement(
|
|
7835
7898
|
ArtifactsPanel,
|
|
7836
7899
|
{
|
|
7837
7900
|
nodes: artifactNodes,
|
|
7901
|
+
loading: artifactsLoading,
|
|
7838
7902
|
openArtifactId: panelOpenArtifactId,
|
|
7839
7903
|
onArtifactClosed: handleArtifactPanelClosed,
|
|
7840
7904
|
getArtifactActions,
|
|
@@ -7842,7 +7906,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7842
7906
|
}
|
|
7843
7907
|
);
|
|
7844
7908
|
case "todos":
|
|
7845
|
-
return tasks.length > 0 ? /* @__PURE__ */
|
|
7909
|
+
return tasks.length > 0 ? /* @__PURE__ */ import_react94.default.createElement(
|
|
7846
7910
|
TodosList,
|
|
7847
7911
|
{
|
|
7848
7912
|
tasks,
|
|
@@ -7850,20 +7914,20 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7850
7914
|
onStopAllTasks,
|
|
7851
7915
|
className: "h-full"
|
|
7852
7916
|
}
|
|
7853
|
-
) : /* @__PURE__ */
|
|
7917
|
+
) : /* @__PURE__ */ import_react94.default.createElement("div", { className: "h-full flex flex-col" }, /* @__PURE__ */ import_react94.default.createElement("div", { className: "flex items-center p-4 border-b border-ash/40 shrink-0" }, /* @__PURE__ */ import_react94.default.createElement("h3", { className: "text-xs font-medium text-white" }, "Tasks")), /* @__PURE__ */ import_react94.default.createElement("div", { className: "flex-1 flex items-center justify-center" }, /* @__PURE__ */ import_react94.default.createElement("p", { className: "text-xs text-silver/60" }, "No tasks")));
|
|
7854
7918
|
default: {
|
|
7855
7919
|
const externalTool = externalTools.find((t) => t.id === toolId);
|
|
7856
7920
|
return externalTool?.content ?? null;
|
|
7857
7921
|
}
|
|
7858
7922
|
}
|
|
7859
7923
|
};
|
|
7860
|
-
return /* @__PURE__ */
|
|
7924
|
+
return /* @__PURE__ */ import_react94.default.createElement(
|
|
7861
7925
|
"div",
|
|
7862
7926
|
{
|
|
7863
7927
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
7864
7928
|
...rest
|
|
7865
7929
|
},
|
|
7866
|
-
hasLeftTools && /* @__PURE__ */
|
|
7930
|
+
hasLeftTools && /* @__PURE__ */ import_react94.default.createElement(
|
|
7867
7931
|
ToolSidebar,
|
|
7868
7932
|
{
|
|
7869
7933
|
tools: leftToolDefs,
|
|
@@ -7872,7 +7936,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7872
7936
|
side: "left"
|
|
7873
7937
|
}
|
|
7874
7938
|
),
|
|
7875
|
-
isLeftPanelOpen && /* @__PURE__ */
|
|
7939
|
+
isLeftPanelOpen && /* @__PURE__ */ import_react94.default.createElement(
|
|
7876
7940
|
ToolPanelContainer,
|
|
7877
7941
|
{
|
|
7878
7942
|
topContent: renderToolContent(activeTools["top-left"]),
|
|
@@ -7883,16 +7947,16 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7883
7947
|
initialTopPercent: 30
|
|
7884
7948
|
}
|
|
7885
7949
|
),
|
|
7886
|
-
/* @__PURE__ */
|
|
7950
|
+
/* @__PURE__ */ import_react94.default.createElement("div", { className: "flex-1 flex flex-col min-w-0 relative" }, /* @__PURE__ */ import_react94.default.createElement("div", { className: cx(
|
|
7887
7951
|
"flex-1 flex flex-col min-h-0 relative",
|
|
7888
7952
|
isEmpty ? "justify-center" : "justify-start"
|
|
7889
|
-
) }, /* @__PURE__ */
|
|
7953
|
+
) }, /* @__PURE__ */ import_react94.default.createElement("div", { className: cx(
|
|
7890
7954
|
"transition-all duration-500 ease-in-out",
|
|
7891
7955
|
isEmpty ? "flex-1" : "flex-zero"
|
|
7892
|
-
) }), /* @__PURE__ */
|
|
7893
|
-
"transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
7956
|
+
) }), /* @__PURE__ */ import_react94.default.createElement("div", { className: cx(
|
|
7957
|
+
"relative transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
7894
7958
|
isEmpty ? "flex-zero opacity-0" : "flex-1 opacity-100"
|
|
7895
|
-
) }, /* @__PURE__ */
|
|
7959
|
+
) }, /* @__PURE__ */ import_react94.default.createElement(
|
|
7896
7960
|
ChatView,
|
|
7897
7961
|
{
|
|
7898
7962
|
items: displayItems,
|
|
@@ -7901,17 +7965,17 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7901
7965
|
thinkingLabel,
|
|
7902
7966
|
className: "flex-1"
|
|
7903
7967
|
}
|
|
7904
|
-
)), /* @__PURE__ */
|
|
7968
|
+
), chatLoading && /* @__PURE__ */ import_react94.default.createElement(BusyOverlay, null)), /* @__PURE__ */ import_react94.default.createElement("div", { className: cx(
|
|
7905
7969
|
"transition-all duration-500 ease-in-out z-10 w-full flex flex-col items-center",
|
|
7906
7970
|
isEmpty ? "p-4" : "shrink-0 p-4 border-t border-ash/40 bg-obsidian"
|
|
7907
|
-
) }, isEmpty && /* @__PURE__ */
|
|
7971
|
+
) }, isEmpty && /* @__PURE__ */ import_react94.default.createElement("div", { className: "mb-8 text-center animate-fade-in duration-500" }, emptyState ? emptyState : /* @__PURE__ */ import_react94.default.createElement("h1", { className: "text-4xl md:text-5xl font-heading text-gold mb-2 tracking-tight" }, "Welcome!")), /* @__PURE__ */ import_react94.default.createElement(
|
|
7908
7972
|
ChatInput,
|
|
7909
7973
|
{
|
|
7910
7974
|
position: isEmpty ? "centered" : "bottom",
|
|
7911
7975
|
placeholder,
|
|
7912
7976
|
helperText: isEmpty ? emptyStateHelper : void 0,
|
|
7913
7977
|
onSubmit: handleSubmit,
|
|
7914
|
-
disabled: isEmpty ? isStreaming : isStreaming && !onStop,
|
|
7978
|
+
disabled: inputDisabled || (isEmpty ? isStreaming : isStreaming && !onStop),
|
|
7915
7979
|
isStreaming,
|
|
7916
7980
|
onStop,
|
|
7917
7981
|
showAttachmentButton,
|
|
@@ -7925,11 +7989,11 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7925
7989
|
textareaRef,
|
|
7926
7990
|
onTextareaKeyDown
|
|
7927
7991
|
}
|
|
7928
|
-
)), /* @__PURE__ */
|
|
7992
|
+
)), /* @__PURE__ */ import_react94.default.createElement("div", { className: cx(
|
|
7929
7993
|
"transition-all duration-500 ease-in-out",
|
|
7930
7994
|
isEmpty ? "flex-1" : "flex-zero"
|
|
7931
7995
|
) }))),
|
|
7932
|
-
isRightPanelOpen && /* @__PURE__ */
|
|
7996
|
+
isRightPanelOpen && /* @__PURE__ */ import_react94.default.createElement(
|
|
7933
7997
|
ToolPanelContainer,
|
|
7934
7998
|
{
|
|
7935
7999
|
topContent: renderToolContent(activeTools["top-right"]),
|
|
@@ -7940,7 +8004,7 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7940
8004
|
initialTopPercent: 70
|
|
7941
8005
|
}
|
|
7942
8006
|
),
|
|
7943
|
-
hasRightTools && /* @__PURE__ */
|
|
8007
|
+
hasRightTools && /* @__PURE__ */ import_react94.default.createElement(
|
|
7944
8008
|
ToolSidebar,
|
|
7945
8009
|
{
|
|
7946
8010
|
tools: rightToolDefs,
|
|
@@ -7955,9 +8019,9 @@ var ChatInterface = import_react93.default.forwardRef(
|
|
|
7955
8019
|
ChatInterface.displayName = "ChatInterface";
|
|
7956
8020
|
|
|
7957
8021
|
// src/components/chat/MessageActions.tsx
|
|
7958
|
-
var
|
|
8022
|
+
var import_react95 = __toESM(require("react"));
|
|
7959
8023
|
var import_lucide_react21 = require("lucide-react");
|
|
7960
|
-
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
8024
|
+
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ import_react95.default.createElement(
|
|
7961
8025
|
"button",
|
|
7962
8026
|
{
|
|
7963
8027
|
type: "button",
|
|
@@ -7973,7 +8037,7 @@ var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @_
|
|
|
7973
8037
|
},
|
|
7974
8038
|
children
|
|
7975
8039
|
);
|
|
7976
|
-
var MessageActions =
|
|
8040
|
+
var MessageActions = import_react95.default.forwardRef(
|
|
7977
8041
|
({
|
|
7978
8042
|
variant,
|
|
7979
8043
|
content,
|
|
@@ -7985,12 +8049,12 @@ var MessageActions = import_react94.default.forwardRef(
|
|
|
7985
8049
|
className,
|
|
7986
8050
|
...rest
|
|
7987
8051
|
}, ref) => {
|
|
7988
|
-
const [localIsEditing, setLocalIsEditing] = (0,
|
|
7989
|
-
const [localEditValue, setLocalEditValue] = (0,
|
|
8052
|
+
const [localIsEditing, setLocalIsEditing] = (0, import_react95.useState)(false);
|
|
8053
|
+
const [localEditValue, setLocalEditValue] = (0, import_react95.useState)(content);
|
|
7990
8054
|
const { copied, copy } = useCopyToClipboard();
|
|
7991
8055
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
7992
8056
|
const editValue = controlledEditValue ?? localEditValue;
|
|
7993
|
-
const setIsEditing = (0,
|
|
8057
|
+
const setIsEditing = (0, import_react95.useCallback)(
|
|
7994
8058
|
(value) => {
|
|
7995
8059
|
if (onEditingChange) {
|
|
7996
8060
|
onEditingChange(value);
|
|
@@ -8000,28 +8064,28 @@ var MessageActions = import_react94.default.forwardRef(
|
|
|
8000
8064
|
},
|
|
8001
8065
|
[onEditingChange]
|
|
8002
8066
|
);
|
|
8003
|
-
const setEditValue = (0,
|
|
8067
|
+
const setEditValue = (0, import_react95.useCallback)((value) => {
|
|
8004
8068
|
setLocalEditValue(value);
|
|
8005
8069
|
}, []);
|
|
8006
|
-
const handleCopy = (0,
|
|
8070
|
+
const handleCopy = (0, import_react95.useCallback)(() => {
|
|
8007
8071
|
void copy(content);
|
|
8008
8072
|
}, [copy, content]);
|
|
8009
|
-
const handleStartEdit = (0,
|
|
8073
|
+
const handleStartEdit = (0, import_react95.useCallback)(() => {
|
|
8010
8074
|
setLocalEditValue(content);
|
|
8011
8075
|
setIsEditing(true);
|
|
8012
8076
|
}, [content, setIsEditing]);
|
|
8013
|
-
const handleCancelEdit = (0,
|
|
8077
|
+
const handleCancelEdit = (0, import_react95.useCallback)(() => {
|
|
8014
8078
|
setIsEditing(false);
|
|
8015
8079
|
setLocalEditValue(content);
|
|
8016
8080
|
}, [content, setIsEditing]);
|
|
8017
|
-
const handleSubmitEdit = (0,
|
|
8081
|
+
const handleSubmitEdit = (0, import_react95.useCallback)(() => {
|
|
8018
8082
|
const trimmed = editValue.trim();
|
|
8019
8083
|
if (trimmed && trimmed !== content) {
|
|
8020
8084
|
onEdit?.(trimmed);
|
|
8021
8085
|
}
|
|
8022
8086
|
setIsEditing(false);
|
|
8023
8087
|
}, [editValue, content, onEdit, setIsEditing]);
|
|
8024
|
-
const handleEditKeyDown = (0,
|
|
8088
|
+
const handleEditKeyDown = (0, import_react95.useCallback)(
|
|
8025
8089
|
(e) => {
|
|
8026
8090
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
8027
8091
|
e.preventDefault();
|
|
@@ -8034,19 +8098,19 @@ var MessageActions = import_react94.default.forwardRef(
|
|
|
8034
8098
|
);
|
|
8035
8099
|
const isUser = variant === "user";
|
|
8036
8100
|
if (isUser && isEditing) {
|
|
8037
|
-
return /* @__PURE__ */
|
|
8101
|
+
return /* @__PURE__ */ import_react95.default.createElement(
|
|
8038
8102
|
"div",
|
|
8039
8103
|
{
|
|
8040
8104
|
ref,
|
|
8041
8105
|
className: cx("mt-2", className),
|
|
8042
8106
|
...rest
|
|
8043
8107
|
},
|
|
8044
|
-
/* @__PURE__ */
|
|
8108
|
+
/* @__PURE__ */ import_react95.default.createElement(
|
|
8045
8109
|
"div",
|
|
8046
8110
|
{
|
|
8047
8111
|
className: "relative bg-charcoal border border-ash/60 focus-within:border-gold/60 focus-within:ring-1 focus-within:ring-gold/20"
|
|
8048
8112
|
},
|
|
8049
|
-
/* @__PURE__ */
|
|
8113
|
+
/* @__PURE__ */ import_react95.default.createElement(
|
|
8050
8114
|
"textarea",
|
|
8051
8115
|
{
|
|
8052
8116
|
value: editValue,
|
|
@@ -8057,15 +8121,15 @@ var MessageActions = import_react94.default.forwardRef(
|
|
|
8057
8121
|
rows: 2
|
|
8058
8122
|
}
|
|
8059
8123
|
),
|
|
8060
|
-
/* @__PURE__ */
|
|
8124
|
+
/* @__PURE__ */ import_react95.default.createElement("div", { className: "absolute right-2 bottom-2 flex gap-1" }, /* @__PURE__ */ import_react95.default.createElement(
|
|
8061
8125
|
ActionButton2,
|
|
8062
8126
|
{
|
|
8063
8127
|
onClick: handleCancelEdit,
|
|
8064
8128
|
label: "Cancel edit",
|
|
8065
8129
|
className: "text-silver/60 hover:text-error"
|
|
8066
8130
|
},
|
|
8067
|
-
/* @__PURE__ */
|
|
8068
|
-
), /* @__PURE__ */
|
|
8131
|
+
/* @__PURE__ */ import_react95.default.createElement(import_lucide_react21.X, { className: "w-4 h-4" })
|
|
8132
|
+
), /* @__PURE__ */ import_react95.default.createElement(
|
|
8069
8133
|
ActionButton2,
|
|
8070
8134
|
{
|
|
8071
8135
|
onClick: handleSubmitEdit,
|
|
@@ -8073,13 +8137,13 @@ var MessageActions = import_react94.default.forwardRef(
|
|
|
8073
8137
|
className: "text-silver/60 hover:text-gold",
|
|
8074
8138
|
disabled: !editValue.trim() || editValue.trim() === content
|
|
8075
8139
|
},
|
|
8076
|
-
/* @__PURE__ */
|
|
8140
|
+
/* @__PURE__ */ import_react95.default.createElement(import_lucide_react21.Send, { className: "w-4 h-4" })
|
|
8077
8141
|
))
|
|
8078
8142
|
),
|
|
8079
|
-
/* @__PURE__ */
|
|
8143
|
+
/* @__PURE__ */ import_react95.default.createElement("p", { className: "text-xs text-silver/50 mt-1" }, "Press Enter to submit, Esc to cancel. This will create a new branch.")
|
|
8080
8144
|
);
|
|
8081
8145
|
}
|
|
8082
|
-
return /* @__PURE__ */
|
|
8146
|
+
return /* @__PURE__ */ import_react95.default.createElement(
|
|
8083
8147
|
"div",
|
|
8084
8148
|
{
|
|
8085
8149
|
ref,
|
|
@@ -8090,18 +8154,18 @@ var MessageActions = import_react94.default.forwardRef(
|
|
|
8090
8154
|
),
|
|
8091
8155
|
...rest
|
|
8092
8156
|
},
|
|
8093
|
-
/* @__PURE__ */
|
|
8094
|
-
isUser && onEdit && /* @__PURE__ */
|
|
8095
|
-
!isUser && onRetry && /* @__PURE__ */
|
|
8157
|
+
/* @__PURE__ */ import_react95.default.createElement(ActionButton2, { onClick: handleCopy, label: copied ? "Copied!" : "Copy message" }, copied ? /* @__PURE__ */ import_react95.default.createElement(import_lucide_react21.Check, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ import_react95.default.createElement(import_lucide_react21.Copy, { className: "w-3.5 h-3.5" })),
|
|
8158
|
+
isUser && onEdit && /* @__PURE__ */ import_react95.default.createElement(ActionButton2, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react95.default.createElement(import_lucide_react21.Pencil, { className: "w-3.5 h-3.5" })),
|
|
8159
|
+
!isUser && onRetry && /* @__PURE__ */ import_react95.default.createElement(ActionButton2, { onClick: onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react95.default.createElement(import_lucide_react21.RotateCcw, { className: "w-3.5 h-3.5" }))
|
|
8096
8160
|
);
|
|
8097
8161
|
}
|
|
8098
8162
|
);
|
|
8099
8163
|
MessageActions.displayName = "MessageActions";
|
|
8100
8164
|
|
|
8101
8165
|
// src/components/chat/BranchNavigator.tsx
|
|
8102
|
-
var
|
|
8166
|
+
var import_react96 = __toESM(require("react"));
|
|
8103
8167
|
var import_lucide_react22 = require("lucide-react");
|
|
8104
|
-
var BranchNavigator =
|
|
8168
|
+
var BranchNavigator = import_react96.default.forwardRef(
|
|
8105
8169
|
({
|
|
8106
8170
|
current,
|
|
8107
8171
|
total,
|
|
@@ -8120,7 +8184,7 @@ var BranchNavigator = import_react95.default.forwardRef(
|
|
|
8120
8184
|
const buttonSize = size === "sm" ? "p-0.5" : "p-1";
|
|
8121
8185
|
const iconSize = size === "sm" ? "w-3 h-3" : "w-4 h-4";
|
|
8122
8186
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
8123
|
-
return /* @__PURE__ */
|
|
8187
|
+
return /* @__PURE__ */ import_react96.default.createElement(
|
|
8124
8188
|
"div",
|
|
8125
8189
|
{
|
|
8126
8190
|
ref,
|
|
@@ -8132,8 +8196,8 @@ var BranchNavigator = import_react95.default.forwardRef(
|
|
|
8132
8196
|
"aria-label": "Branch navigation",
|
|
8133
8197
|
...rest
|
|
8134
8198
|
},
|
|
8135
|
-
showIcon && /* @__PURE__ */
|
|
8136
|
-
/* @__PURE__ */
|
|
8199
|
+
showIcon && /* @__PURE__ */ import_react96.default.createElement(import_lucide_react22.GitBranch, { className: cx(iconSize, "mr-0.5 text-silver/50"), "aria-hidden": "true" }),
|
|
8200
|
+
/* @__PURE__ */ import_react96.default.createElement(
|
|
8137
8201
|
"button",
|
|
8138
8202
|
{
|
|
8139
8203
|
type: "button",
|
|
@@ -8146,10 +8210,10 @@ var BranchNavigator = import_react95.default.forwardRef(
|
|
|
8146
8210
|
),
|
|
8147
8211
|
"aria-label": "Previous branch"
|
|
8148
8212
|
},
|
|
8149
|
-
/* @__PURE__ */
|
|
8213
|
+
/* @__PURE__ */ import_react96.default.createElement(import_lucide_react22.ChevronLeft, { className: iconSize })
|
|
8150
8214
|
),
|
|
8151
|
-
/* @__PURE__ */
|
|
8152
|
-
/* @__PURE__ */
|
|
8215
|
+
/* @__PURE__ */ import_react96.default.createElement("span", { className: cx(textSize, "tabular-nums min-w-6 text-center") }, current, "/", total),
|
|
8216
|
+
/* @__PURE__ */ import_react96.default.createElement(
|
|
8153
8217
|
"button",
|
|
8154
8218
|
{
|
|
8155
8219
|
type: "button",
|
|
@@ -8162,7 +8226,7 @@ var BranchNavigator = import_react95.default.forwardRef(
|
|
|
8162
8226
|
),
|
|
8163
8227
|
"aria-label": "Next branch"
|
|
8164
8228
|
},
|
|
8165
|
-
/* @__PURE__ */
|
|
8229
|
+
/* @__PURE__ */ import_react96.default.createElement(import_lucide_react22.ChevronRight, { className: iconSize })
|
|
8166
8230
|
)
|
|
8167
8231
|
);
|
|
8168
8232
|
}
|
|
@@ -8170,16 +8234,16 @@ var BranchNavigator = import_react95.default.forwardRef(
|
|
|
8170
8234
|
BranchNavigator.displayName = "BranchNavigator";
|
|
8171
8235
|
|
|
8172
8236
|
// src/components/BrandIcon.tsx
|
|
8173
|
-
var
|
|
8237
|
+
var import_react97 = __toESM(require("react"));
|
|
8174
8238
|
var sizeMap2 = {
|
|
8175
8239
|
sm: "h-8 w-8 text-sm",
|
|
8176
8240
|
md: "h-12 w-12 text-base",
|
|
8177
8241
|
lg: "h-16 w-16 text-lg"
|
|
8178
8242
|
};
|
|
8179
|
-
var BrandIcon =
|
|
8243
|
+
var BrandIcon = import_react97.default.forwardRef(
|
|
8180
8244
|
({ size = "md", variant = "solid", children, className, ...rest }, ref) => {
|
|
8181
8245
|
const variantClasses = variant === "solid" ? "bg-gold text-obsidian border-2 border-gold" : "bg-transparent text-gold border-2 border-gold";
|
|
8182
|
-
return /* @__PURE__ */
|
|
8246
|
+
return /* @__PURE__ */ import_react97.default.createElement(
|
|
8183
8247
|
"div",
|
|
8184
8248
|
{
|
|
8185
8249
|
ref,
|
|
@@ -8198,17 +8262,17 @@ var BrandIcon = import_react96.default.forwardRef(
|
|
|
8198
8262
|
BrandIcon.displayName = "BrandIcon";
|
|
8199
8263
|
|
|
8200
8264
|
// src/components/ColorSwatch.tsx
|
|
8201
|
-
var
|
|
8202
|
-
var ColorSwatch =
|
|
8265
|
+
var import_react98 = __toESM(require("react"));
|
|
8266
|
+
var ColorSwatch = import_react98.default.forwardRef(
|
|
8203
8267
|
({ color, label, className, ...rest }, ref) => {
|
|
8204
|
-
return /* @__PURE__ */
|
|
8268
|
+
return /* @__PURE__ */ import_react98.default.createElement(
|
|
8205
8269
|
"div",
|
|
8206
8270
|
{
|
|
8207
8271
|
ref,
|
|
8208
8272
|
className: cx("flex flex-col items-center gap-2", className),
|
|
8209
8273
|
...rest
|
|
8210
8274
|
},
|
|
8211
|
-
/* @__PURE__ */
|
|
8275
|
+
/* @__PURE__ */ import_react98.default.createElement(
|
|
8212
8276
|
"div",
|
|
8213
8277
|
{
|
|
8214
8278
|
className: "h-16 w-16 border-2 border-ash rounded-none shadow-sm",
|
|
@@ -8216,22 +8280,22 @@ var ColorSwatch = import_react97.default.forwardRef(
|
|
|
8216
8280
|
"aria-label": label || color
|
|
8217
8281
|
}
|
|
8218
8282
|
),
|
|
8219
|
-
label && /* @__PURE__ */
|
|
8283
|
+
label && /* @__PURE__ */ import_react98.default.createElement("span", { className: "text-xs text-silver font-medium" }, label)
|
|
8220
8284
|
);
|
|
8221
8285
|
}
|
|
8222
8286
|
);
|
|
8223
8287
|
ColorSwatch.displayName = "ColorSwatch";
|
|
8224
8288
|
|
|
8225
8289
|
// src/components/SectionHeading.tsx
|
|
8226
|
-
var
|
|
8290
|
+
var import_react99 = __toESM(require("react"));
|
|
8227
8291
|
var levelStyles = {
|
|
8228
8292
|
h2: "text-2xl mb-4",
|
|
8229
8293
|
h3: "text-xl mb-3"
|
|
8230
8294
|
};
|
|
8231
|
-
var SectionHeading =
|
|
8295
|
+
var SectionHeading = import_react99.default.forwardRef(
|
|
8232
8296
|
({ level = "h2", children, className, ...rest }, ref) => {
|
|
8233
8297
|
const Component = level;
|
|
8234
|
-
return /* @__PURE__ */
|
|
8298
|
+
return /* @__PURE__ */ import_react99.default.createElement(
|
|
8235
8299
|
Component,
|
|
8236
8300
|
{
|
|
8237
8301
|
ref,
|
|
@@ -8282,6 +8346,7 @@ var version = "2.0.0";
|
|
|
8282
8346
|
Breadcrumb,
|
|
8283
8347
|
BreadcrumbItem,
|
|
8284
8348
|
BreadcrumbLink,
|
|
8349
|
+
BusyOverlay,
|
|
8285
8350
|
Button,
|
|
8286
8351
|
Card,
|
|
8287
8352
|
ChatBubbleIcon,
|