ai-design-system 0.1.5 → 0.1.7
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/components/ai-elements/confirmation.tsx +2 -2
- package/components/ai-elements/inline-citation.tsx +15 -4
- package/components/ai-elements/prompt-input.tsx +9 -5
- package/components/ai-elements/reasoning.tsx +14 -3
- package/components/ai-elements/shimmer.tsx +2 -10
- package/components/ai-elements/tool.tsx +2 -2
- package/components/ai-elements/web-preview.tsx +5 -2
- package/components/blocks/FileChangeQueue/FileChangeQueue.tsx +5 -5
- package/components/blocks/WorkflowCanvas/WorkflowCanvas.tsx +3 -0
- package/components/composites/DocumentEditor/DocumentEditor.tsx +8 -6
- package/components/composites/InteractiveChart/InteractiveChart.tsx +1 -1
- package/components/composites/TablePagination/TablePagination.tsx +1 -1
- package/components/composites/TableToolbar/TableToolbar.tsx +1 -1
- package/components/features/WorkflowBuilder/WorkflowBuilder.tsx +3 -0
- package/components/ui/carousel.tsx +12 -4
- package/components/ui/chart.tsx +12 -12
- package/dist/index.cjs +27 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +167 -79
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/package.json +17 -4
|
@@ -163,12 +163,23 @@ export const InlineCitationCarouselIndex = ({
|
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
const updateState = () => {
|
|
167
|
+
setCount(api.scrollSnapList().length);
|
|
168
|
+
setCurrent(api.selectedScrollSnap() + 1);
|
|
169
|
+
};
|
|
168
170
|
|
|
169
|
-
|
|
171
|
+
const handleSelect = () => {
|
|
170
172
|
setCurrent(api.selectedScrollSnap() + 1);
|
|
171
|
-
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// Use requestAnimationFrame to defer state updates
|
|
176
|
+
requestAnimationFrame(updateState);
|
|
177
|
+
|
|
178
|
+
api.on("select", handleSelect);
|
|
179
|
+
|
|
180
|
+
return () => {
|
|
181
|
+
api.off("select", handleSelect);
|
|
182
|
+
};
|
|
172
183
|
}, [api]);
|
|
173
184
|
|
|
174
185
|
return (
|
|
@@ -997,13 +997,13 @@ interface SpeechRecognition extends EventTarget {
|
|
|
997
997
|
lang: string;
|
|
998
998
|
start(): void;
|
|
999
999
|
stop(): void;
|
|
1000
|
-
onstart: ((this: SpeechRecognition, ev: Event) =>
|
|
1001
|
-
onend: ((this: SpeechRecognition, ev: Event) =>
|
|
1000
|
+
onstart: ((this: SpeechRecognition, ev: Event) => void) | null;
|
|
1001
|
+
onend: ((this: SpeechRecognition, ev: Event) => void) | null;
|
|
1002
1002
|
onresult:
|
|
1003
|
-
| ((this: SpeechRecognition, ev: SpeechRecognitionEvent) =>
|
|
1003
|
+
| ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => void)
|
|
1004
1004
|
| null;
|
|
1005
1005
|
onerror:
|
|
1006
|
-
| ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) =>
|
|
1006
|
+
| ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => void)
|
|
1007
1007
|
| null;
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
@@ -1113,7 +1113,11 @@ export const PromptInputSpeechButton = ({
|
|
|
1113
1113
|
};
|
|
1114
1114
|
|
|
1115
1115
|
recognitionRef.current = speechRecognition;
|
|
1116
|
-
|
|
1116
|
+
|
|
1117
|
+
// Defer state update to avoid cascading renders
|
|
1118
|
+
requestAnimationFrame(() => {
|
|
1119
|
+
setRecognition(speechRecognition);
|
|
1120
|
+
});
|
|
1117
1121
|
}
|
|
1118
1122
|
|
|
1119
1123
|
return () => {
|
|
@@ -69,12 +69,22 @@ export const Reasoning = memo(
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
if (isStreaming) {
|
|
71
71
|
if (startTime === null) {
|
|
72
|
-
|
|
72
|
+
// Defer state update to avoid cascading renders
|
|
73
|
+
const timer = setTimeout(() => {
|
|
74
|
+
setStartTime(Date.now());
|
|
75
|
+
}, 0);
|
|
76
|
+
return () => clearTimeout(timer);
|
|
73
77
|
}
|
|
74
78
|
} else if (startTime !== null) {
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
const calculatedDuration = Math.ceil((Date.now() - startTime) / MS_IN_S);
|
|
80
|
+
// Use setTimeout to defer state updates and avoid cascading renders
|
|
81
|
+
const timer = setTimeout(() => {
|
|
82
|
+
setDuration(calculatedDuration);
|
|
83
|
+
setStartTime(null);
|
|
84
|
+
}, 0);
|
|
85
|
+
return () => clearTimeout(timer);
|
|
77
86
|
}
|
|
87
|
+
return undefined;
|
|
78
88
|
}, [isStreaming, startTime, setDuration]);
|
|
79
89
|
|
|
80
90
|
// Auto-open when streaming starts, auto-close when streaming ends (once only)
|
|
@@ -88,6 +98,7 @@ export const Reasoning = memo(
|
|
|
88
98
|
|
|
89
99
|
return () => clearTimeout(timer);
|
|
90
100
|
}
|
|
101
|
+
return undefined;
|
|
91
102
|
}, [isStreaming, isOpen, defaultOpen, setIsOpen, hasAutoClosed]);
|
|
92
103
|
|
|
93
104
|
const handleOpenChange = (newOpen: boolean) => {
|
|
@@ -4,15 +4,12 @@ import { cn } from "@/lib/utils";
|
|
|
4
4
|
import { motion } from "motion/react";
|
|
5
5
|
import {
|
|
6
6
|
type CSSProperties,
|
|
7
|
-
type ElementType,
|
|
8
|
-
type JSX,
|
|
9
7
|
memo,
|
|
10
8
|
useMemo,
|
|
11
9
|
} from "react";
|
|
12
10
|
|
|
13
11
|
export type TextShimmerProps = {
|
|
14
12
|
children: string;
|
|
15
|
-
as?: ElementType;
|
|
16
13
|
className?: string;
|
|
17
14
|
duration?: number;
|
|
18
15
|
spread?: number;
|
|
@@ -20,22 +17,17 @@ export type TextShimmerProps = {
|
|
|
20
17
|
|
|
21
18
|
const ShimmerComponent = ({
|
|
22
19
|
children,
|
|
23
|
-
as: Component = "p",
|
|
24
20
|
className,
|
|
25
21
|
duration = 2,
|
|
26
22
|
spread = 2,
|
|
27
23
|
}: TextShimmerProps) => {
|
|
28
|
-
const MotionComponent = motion.create(
|
|
29
|
-
Component as keyof JSX.IntrinsicElements
|
|
30
|
-
);
|
|
31
|
-
|
|
32
24
|
const dynamicSpread = useMemo(
|
|
33
25
|
() => (children?.length ?? 0) * spread,
|
|
34
26
|
[children, spread]
|
|
35
27
|
);
|
|
36
28
|
|
|
37
29
|
return (
|
|
38
|
-
<
|
|
30
|
+
<motion.p
|
|
39
31
|
animate={{ backgroundPosition: "0% center" }}
|
|
40
32
|
className={cn(
|
|
41
33
|
"relative inline-block bg-size-[250%_100%,auto] bg-clip-text text-transparent",
|
|
@@ -57,7 +49,7 @@ const ShimmerComponent = ({
|
|
|
57
49
|
}}
|
|
58
50
|
>
|
|
59
51
|
{children}
|
|
60
|
-
</
|
|
52
|
+
</motion.p>
|
|
61
53
|
);
|
|
62
54
|
};
|
|
63
55
|
|
|
@@ -137,7 +137,10 @@ export const WebPreviewUrl = ({
|
|
|
137
137
|
|
|
138
138
|
// Sync input value with context URL when it changes externally
|
|
139
139
|
useEffect(() => {
|
|
140
|
-
|
|
140
|
+
// Defer state update to avoid cascading renders
|
|
141
|
+
requestAnimationFrame(() => {
|
|
142
|
+
setInputValue(url);
|
|
143
|
+
});
|
|
141
144
|
}, [url]);
|
|
142
145
|
|
|
143
146
|
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
@@ -157,7 +160,7 @@ export const WebPreviewUrl = ({
|
|
|
157
160
|
<Input
|
|
158
161
|
className="h-8 flex-1 text-sm"
|
|
159
162
|
onChange={onChange ?? handleChange}
|
|
160
|
-
onKeyDown={handleKeyDown}
|
|
163
|
+
onKeyDown={onKeyDown ?? handleKeyDown}
|
|
161
164
|
placeholder="Enter URL..."
|
|
162
165
|
value={value ?? inputValue}
|
|
163
166
|
{...props}
|
|
@@ -114,17 +114,17 @@ const transformFileChangesToGroups = (
|
|
|
114
114
|
*/
|
|
115
115
|
export const FileChangeQueue = React.memo<FileChangeQueueProps>(
|
|
116
116
|
({ changes, title, state, approval, onApprove, onReject, className }) => {
|
|
117
|
-
// Only display if at least 1 file change exists
|
|
118
|
-
if (changes.length === 0) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
117
|
// Transform file changes to groups
|
|
123
118
|
const groups = React.useMemo(
|
|
124
119
|
() => transformFileChangesToGroups(changes),
|
|
125
120
|
[changes]
|
|
126
121
|
);
|
|
127
122
|
|
|
123
|
+
// Only display if at least 1 file change exists
|
|
124
|
+
if (changes.length === 0) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
128
|
return (
|
|
129
129
|
<Confirmation
|
|
130
130
|
title={title}
|
|
@@ -42,6 +42,7 @@ export interface WorkflowCanvasProps {
|
|
|
42
42
|
onConnectStart?: (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
|
|
43
43
|
onConnectEnd?: (event: MouseEvent | TouchEvent) => void;
|
|
44
44
|
onPaneClick?: () => void;
|
|
45
|
+
onEdgeClick?: (event: React.MouseEvent, edge: WorkflowEdge) => void;
|
|
45
46
|
showMinimap?: boolean;
|
|
46
47
|
/** Enable/disable manual drawing of connections and node dragging. Default: false */
|
|
47
48
|
interactive?: boolean;
|
|
@@ -71,6 +72,7 @@ function WorkflowCanvasInner({
|
|
|
71
72
|
onConnectStart,
|
|
72
73
|
onConnectEnd,
|
|
73
74
|
onPaneClick,
|
|
75
|
+
onEdgeClick,
|
|
74
76
|
showMinimap = false,
|
|
75
77
|
interactive = false,
|
|
76
78
|
topLeft,
|
|
@@ -140,6 +142,7 @@ function WorkflowCanvasInner({
|
|
|
140
142
|
onEdgesChange={interactive ? onEdgesChange : undefined}
|
|
141
143
|
onNodesChange={interactive ? onNodesChange : undefined}
|
|
142
144
|
onPaneClick={onPaneClick}
|
|
145
|
+
onEdgeClick={onEdgeClick}
|
|
143
146
|
>
|
|
144
147
|
{topLeft && (
|
|
145
148
|
<Panel
|
|
@@ -141,21 +141,23 @@ export const DocumentEditor = React.memo<DocumentEditorProps>(
|
|
|
141
141
|
|
|
142
142
|
// Small delay to ensure selection is finalized
|
|
143
143
|
setTimeout(() => {
|
|
144
|
-
|
|
144
|
+
const { from, to, empty } = editor.state.selection
|
|
145
145
|
if (!empty) {
|
|
146
146
|
let text = editor.state.doc.textBetween(from, to)
|
|
147
|
+
let adjustedFrom = from
|
|
148
|
+
let adjustedTo = to
|
|
147
149
|
|
|
148
150
|
// Trim leading whitespace and adjust range
|
|
149
151
|
const leadingWhitespace = text.match(/^\s+/)
|
|
150
152
|
if (leadingWhitespace) {
|
|
151
|
-
|
|
153
|
+
adjustedFrom += leadingWhitespace[0].length
|
|
152
154
|
text = text.trimStart()
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
// Trim trailing whitespace and adjust range
|
|
156
158
|
const trailingWhitespace = text.match(/\s+$/)
|
|
157
159
|
if (trailingWhitespace) {
|
|
158
|
-
|
|
160
|
+
adjustedTo -= trailingWhitespace[0].length
|
|
159
161
|
text = text.trimEnd()
|
|
160
162
|
}
|
|
161
163
|
|
|
@@ -164,7 +166,7 @@ export const DocumentEditor = React.memo<DocumentEditorProps>(
|
|
|
164
166
|
|
|
165
167
|
// Log selected text for API usage
|
|
166
168
|
console.log('Selected text:', text)
|
|
167
|
-
console.log('Selection range:', { from, to })
|
|
169
|
+
console.log('Selection range:', { from: adjustedFrom, to: adjustedTo })
|
|
168
170
|
|
|
169
171
|
// Calculate position for CommentBox based on selection
|
|
170
172
|
const selection = window.getSelection()
|
|
@@ -179,9 +181,9 @@ export const DocumentEditor = React.memo<DocumentEditorProps>(
|
|
|
179
181
|
// Clear the browser selection
|
|
180
182
|
selection.removeAllRanges()
|
|
181
183
|
|
|
182
|
-
onTextSelect({ from, to }, text, position)
|
|
184
|
+
onTextSelect({ from: adjustedFrom, to: adjustedTo }, text, position)
|
|
183
185
|
} else {
|
|
184
|
-
onTextSelect({ from, to }, text)
|
|
186
|
+
onTextSelect({ from: adjustedFrom, to: adjustedTo }, text)
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
189
|
}, 10)
|
|
@@ -7,7 +7,7 @@ import { ToggleGroup, ToggleGroupItem } from "@/components/primitives/ToggleGrou
|
|
|
7
7
|
export interface InteractiveChartProps {
|
|
8
8
|
title: string
|
|
9
9
|
description?: string
|
|
10
|
-
data:
|
|
10
|
+
data: unknown[]
|
|
11
11
|
config: ChartConfig
|
|
12
12
|
timeRanges?: { label: string; value: string }[]
|
|
13
13
|
defaultTimeRange?: string
|
|
@@ -11,7 +11,7 @@ import { Icon } from "@/components/primitives/Icon"
|
|
|
11
11
|
import type { Table } from "@tanstack/react-table"
|
|
12
12
|
|
|
13
13
|
export interface TableToolbarProps {
|
|
14
|
-
table: Table<
|
|
14
|
+
table: Table<unknown>
|
|
15
15
|
searchPlaceholder?: string
|
|
16
16
|
searchColumn?: string
|
|
17
17
|
actions?: React.ReactNode
|
|
@@ -20,6 +20,7 @@ export interface WorkflowBuilderProps {
|
|
|
20
20
|
onNodesChange?: (changes: NodeChange[]) => void;
|
|
21
21
|
onEdgesChange?: (changes: EdgeChange[]) => void;
|
|
22
22
|
onConnect?: (connection: Connection) => void;
|
|
23
|
+
onEdgeClick?: (event: React.MouseEvent, edge: WorkflowEdge) => void;
|
|
23
24
|
|
|
24
25
|
// Toolbar — right actions
|
|
25
26
|
isSaving?: boolean;
|
|
@@ -48,6 +49,7 @@ export function WorkflowBuilder({
|
|
|
48
49
|
onNodesChange,
|
|
49
50
|
onEdgesChange,
|
|
50
51
|
onConnect,
|
|
52
|
+
onEdgeClick,
|
|
51
53
|
isSaving = false,
|
|
52
54
|
hasUnsavedChanges = false,
|
|
53
55
|
canUndo = false,
|
|
@@ -96,6 +98,7 @@ export function WorkflowBuilder({
|
|
|
96
98
|
onConnect={onConnect}
|
|
97
99
|
onEdgesChange={onEdgesChange}
|
|
98
100
|
onNodesChange={onNodesChange}
|
|
101
|
+
onEdgeClick={onEdgeClick}
|
|
99
102
|
/>
|
|
100
103
|
</div>
|
|
101
104
|
);
|
|
@@ -95,12 +95,20 @@ function Carousel({
|
|
|
95
95
|
|
|
96
96
|
React.useEffect(() => {
|
|
97
97
|
if (!api) return
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
|
|
99
|
+
const handleSelect = () => {
|
|
100
|
+
onSelect(api)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Initial call
|
|
104
|
+
handleSelect()
|
|
105
|
+
|
|
106
|
+
api.on("reInit", handleSelect)
|
|
107
|
+
api.on("select", handleSelect)
|
|
101
108
|
|
|
102
109
|
return () => {
|
|
103
|
-
api
|
|
110
|
+
api.off("reInit", handleSelect)
|
|
111
|
+
api.off("select", handleSelect)
|
|
104
112
|
}
|
|
105
113
|
}, [api, onSelect])
|
|
106
114
|
|
package/components/ui/chart.tsx
CHANGED
|
@@ -105,16 +105,16 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
105
105
|
HTMLDivElement,
|
|
106
106
|
React.ComponentProps<"div"> & {
|
|
107
107
|
active?: boolean
|
|
108
|
-
payload?:
|
|
108
|
+
payload?: unknown[]
|
|
109
109
|
label?: string
|
|
110
110
|
hideLabel?: boolean
|
|
111
111
|
hideIndicator?: boolean
|
|
112
112
|
indicator?: "line" | "dot" | "dashed"
|
|
113
113
|
nameKey?: string
|
|
114
114
|
labelKey?: string
|
|
115
|
-
labelFormatter?: (value:
|
|
115
|
+
labelFormatter?: (value: unknown, payload: unknown[]) => React.ReactNode
|
|
116
116
|
labelClassName?: string
|
|
117
|
-
formatter?: (value:
|
|
117
|
+
formatter?: (value: unknown, name: unknown, item: unknown, index: number, payload: unknown) => React.ReactNode
|
|
118
118
|
color?: string
|
|
119
119
|
}
|
|
120
120
|
>(
|
|
@@ -143,7 +143,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
143
143
|
return null
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
const [item] = payload
|
|
146
|
+
const [item] = payload as Record<string, unknown>[]
|
|
147
147
|
const key = `${labelKey || item.dataKey || item.name || "value"}`
|
|
148
148
|
const itemConfig = config[key as keyof typeof config]
|
|
149
149
|
const value =
|
|
@@ -190,14 +190,14 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
190
190
|
>
|
|
191
191
|
{!nestLabel ? tooltipLabel : null}
|
|
192
192
|
<div className="grid gap-1.5">
|
|
193
|
-
{payload.map((item, index) => {
|
|
193
|
+
{(payload as Record<string, unknown>[]).map((item, index) => {
|
|
194
194
|
const key = `${nameKey || item.name || item.dataKey || "value"}`
|
|
195
195
|
const itemConfig = config[key as keyof typeof config]
|
|
196
|
-
const indicatorColor = color || item.payload
|
|
196
|
+
const indicatorColor = color || (item.payload as Record<string, unknown>)?.fill || item.color
|
|
197
197
|
|
|
198
198
|
return (
|
|
199
199
|
<div
|
|
200
|
-
key={item.dataKey}
|
|
200
|
+
key={item.dataKey as string}
|
|
201
201
|
className={cn(
|
|
202
202
|
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
203
203
|
indicator === "dot" && "items-center"
|
|
@@ -245,7 +245,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
245
245
|
</div>
|
|
246
246
|
{item.value && (
|
|
247
247
|
<span className="font-mono font-medium tabular-nums text-foreground">
|
|
248
|
-
{item.value.toLocaleString()}
|
|
248
|
+
{(item.value as number).toLocaleString()}
|
|
249
249
|
</span>
|
|
250
250
|
)}
|
|
251
251
|
</div>
|
|
@@ -266,7 +266,7 @@ const ChartLegend = RechartsPrimitive.Legend
|
|
|
266
266
|
const ChartLegendContent = React.forwardRef<
|
|
267
267
|
HTMLDivElement,
|
|
268
268
|
React.ComponentProps<"div"> & {
|
|
269
|
-
payload?:
|
|
269
|
+
payload?: unknown[]
|
|
270
270
|
verticalAlign?: "top" | "bottom"
|
|
271
271
|
hideIcon?: boolean
|
|
272
272
|
nameKey?: string
|
|
@@ -291,13 +291,13 @@ const ChartLegendContent = React.forwardRef<
|
|
|
291
291
|
className
|
|
292
292
|
)}
|
|
293
293
|
>
|
|
294
|
-
{payload.map((item) => {
|
|
294
|
+
{(payload as Record<string, unknown>[]).map((item) => {
|
|
295
295
|
const key = `${nameKey || item.dataKey || "value"}`
|
|
296
296
|
const itemConfig = config[key as keyof typeof config]
|
|
297
297
|
|
|
298
298
|
return (
|
|
299
299
|
<div
|
|
300
|
-
key={item.value}
|
|
300
|
+
key={item.value as string}
|
|
301
301
|
className={cn(
|
|
302
302
|
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
|
|
303
303
|
)}
|
|
@@ -308,7 +308,7 @@ const ChartLegendContent = React.forwardRef<
|
|
|
308
308
|
<div
|
|
309
309
|
className="h-2 w-2 shrink-0 rounded-[2px]"
|
|
310
310
|
style={{
|
|
311
|
-
backgroundColor: item.color,
|
|
311
|
+
backgroundColor: item.color as string,
|
|
312
312
|
}}
|
|
313
313
|
/>
|
|
314
314
|
)}
|
package/dist/index.cjs
CHANGED
|
@@ -823,11 +823,15 @@ function Carousel(_a) {
|
|
|
823
823
|
}, [api, setApi]);
|
|
824
824
|
React33__namespace.useEffect(() => {
|
|
825
825
|
if (!api) return;
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
826
|
+
const handleSelect = () => {
|
|
827
|
+
onSelect(api);
|
|
828
|
+
};
|
|
829
|
+
handleSelect();
|
|
830
|
+
api.on("reInit", handleSelect);
|
|
831
|
+
api.on("select", handleSelect);
|
|
829
832
|
return () => {
|
|
830
|
-
api
|
|
833
|
+
api.off("reInit", handleSelect);
|
|
834
|
+
api.off("select", handleSelect);
|
|
831
835
|
};
|
|
832
836
|
}, [api, onSelect]);
|
|
833
837
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1116,9 +1120,10 @@ var ChartTooltipContent = React33__namespace.forwardRef(
|
|
|
1116
1120
|
children: [
|
|
1117
1121
|
!nestLabel ? tooltipLabel : null,
|
|
1118
1122
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
1123
|
+
var _a;
|
|
1119
1124
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
1120
1125
|
const itemConfig = config[key];
|
|
1121
|
-
const indicatorColor = color || item.payload.fill || item.color;
|
|
1126
|
+
const indicatorColor = color || ((_a = item.payload) == null ? void 0 : _a.fill) || item.color;
|
|
1122
1127
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1123
1128
|
"div",
|
|
1124
1129
|
{
|
|
@@ -4453,14 +4458,10 @@ var UserMessage = React33__namespace.memo(
|
|
|
4453
4458
|
UserMessage.displayName = "UserMessage";
|
|
4454
4459
|
var ShimmerComponent = ({
|
|
4455
4460
|
children,
|
|
4456
|
-
as: Component = "p",
|
|
4457
4461
|
className,
|
|
4458
4462
|
duration = 2,
|
|
4459
4463
|
spread = 2
|
|
4460
4464
|
}) => {
|
|
4461
|
-
const MotionComponent = react$1.motion.create(
|
|
4462
|
-
Component
|
|
4463
|
-
);
|
|
4464
4465
|
const dynamicSpread = React33.useMemo(
|
|
4465
4466
|
() => {
|
|
4466
4467
|
var _a;
|
|
@@ -4469,7 +4470,7 @@ var ShimmerComponent = ({
|
|
|
4469
4470
|
[children, spread]
|
|
4470
4471
|
);
|
|
4471
4472
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4472
|
-
|
|
4473
|
+
react$1.motion.p,
|
|
4473
4474
|
{
|
|
4474
4475
|
animate: { backgroundPosition: "0% center" },
|
|
4475
4476
|
className: cn(
|
|
@@ -6324,22 +6325,24 @@ var DocumentEditor = React33__namespace.default.memo(
|
|
|
6324
6325
|
return;
|
|
6325
6326
|
}
|
|
6326
6327
|
setTimeout(() => {
|
|
6327
|
-
|
|
6328
|
+
const { from, to, empty } = editor.state.selection;
|
|
6328
6329
|
if (!empty) {
|
|
6329
6330
|
let text = editor.state.doc.textBetween(from, to);
|
|
6331
|
+
let adjustedFrom = from;
|
|
6332
|
+
let adjustedTo = to;
|
|
6330
6333
|
const leadingWhitespace = text.match(/^\s+/);
|
|
6331
6334
|
if (leadingWhitespace) {
|
|
6332
|
-
|
|
6335
|
+
adjustedFrom += leadingWhitespace[0].length;
|
|
6333
6336
|
text = text.trimStart();
|
|
6334
6337
|
}
|
|
6335
6338
|
const trailingWhitespace = text.match(/\s+$/);
|
|
6336
6339
|
if (trailingWhitespace) {
|
|
6337
|
-
|
|
6340
|
+
adjustedTo -= trailingWhitespace[0].length;
|
|
6338
6341
|
text = text.trimEnd();
|
|
6339
6342
|
}
|
|
6340
6343
|
if (!text.trim()) return;
|
|
6341
6344
|
console.log("Selected text:", text);
|
|
6342
|
-
console.log("Selection range:", { from, to });
|
|
6345
|
+
console.log("Selection range:", { from: adjustedFrom, to: adjustedTo });
|
|
6343
6346
|
const selection = window.getSelection();
|
|
6344
6347
|
if (selection && selection.rangeCount > 0) {
|
|
6345
6348
|
const range = selection.getRangeAt(0);
|
|
@@ -6350,9 +6353,9 @@ var DocumentEditor = React33__namespace.default.memo(
|
|
|
6350
6353
|
// 8px below selection
|
|
6351
6354
|
};
|
|
6352
6355
|
selection.removeAllRanges();
|
|
6353
|
-
onTextSelect({ from, to }, text, position);
|
|
6356
|
+
onTextSelect({ from: adjustedFrom, to: adjustedTo }, text, position);
|
|
6354
6357
|
} else {
|
|
6355
|
-
onTextSelect({ from, to }, text);
|
|
6358
|
+
onTextSelect({ from: adjustedFrom, to: adjustedTo }, text);
|
|
6356
6359
|
}
|
|
6357
6360
|
}
|
|
6358
6361
|
}, 10);
|
|
@@ -7566,13 +7569,13 @@ var transformFileChangesToGroups = (changes) => {
|
|
|
7566
7569
|
};
|
|
7567
7570
|
var FileChangeQueue = React33__namespace.memo(
|
|
7568
7571
|
({ changes, title, state, approval, onApprove, onReject, className }) => {
|
|
7569
|
-
if (changes.length === 0) {
|
|
7570
|
-
return null;
|
|
7571
|
-
}
|
|
7572
7572
|
const groups = React33__namespace.useMemo(
|
|
7573
7573
|
() => transformFileChangesToGroups(changes),
|
|
7574
7574
|
[changes]
|
|
7575
7575
|
);
|
|
7576
|
+
if (changes.length === 0) {
|
|
7577
|
+
return null;
|
|
7578
|
+
}
|
|
7576
7579
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7577
7580
|
Confirmation2,
|
|
7578
7581
|
{
|
|
@@ -7839,6 +7842,7 @@ function WorkflowCanvasInner({
|
|
|
7839
7842
|
onConnectStart,
|
|
7840
7843
|
onConnectEnd,
|
|
7841
7844
|
onPaneClick,
|
|
7845
|
+
onEdgeClick,
|
|
7842
7846
|
showMinimap = false,
|
|
7843
7847
|
interactive = false,
|
|
7844
7848
|
topLeft,
|
|
@@ -7906,6 +7910,7 @@ function WorkflowCanvasInner({
|
|
|
7906
7910
|
onEdgesChange: interactive ? onEdgesChange : void 0,
|
|
7907
7911
|
onNodesChange: interactive ? onNodesChange : void 0,
|
|
7908
7912
|
onPaneClick,
|
|
7913
|
+
onEdgeClick,
|
|
7909
7914
|
children: [
|
|
7910
7915
|
topLeft && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7911
7916
|
Panel,
|
|
@@ -8108,6 +8113,7 @@ function WorkflowBuilder({
|
|
|
8108
8113
|
onNodesChange,
|
|
8109
8114
|
onEdgesChange,
|
|
8110
8115
|
onConnect,
|
|
8116
|
+
onEdgeClick,
|
|
8111
8117
|
isSaving = false,
|
|
8112
8118
|
hasUnsavedChanges = false,
|
|
8113
8119
|
canUndo = false,
|
|
@@ -8150,7 +8156,8 @@ function WorkflowBuilder({
|
|
|
8150
8156
|
topRight: /* @__PURE__ */ jsxRuntime.jsx(WorkflowToolbarActions, { actionGroups: allActionGroups }),
|
|
8151
8157
|
onConnect,
|
|
8152
8158
|
onEdgesChange,
|
|
8153
|
-
onNodesChange
|
|
8159
|
+
onNodesChange,
|
|
8160
|
+
onEdgeClick
|
|
8154
8161
|
}
|
|
8155
8162
|
) });
|
|
8156
8163
|
}
|