@patterninc/pattern-ui 0.0.0-main.202610210459.504fff4cf4d3 → 0.0.0-main.202610210503.8535dfd740a5
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/ai-elements/reasoning-stepped/reasoning-stepped.js +29 -11
- package/dist/ai-elements/thinking/thinking.js +105 -81
- package/dist/ai-elements/tool-call/tool-call-step.js +150 -91
- package/dist/ai-elements/tool-call/tool-call-trigger.js +127 -77
- package/dist/ai-elements/tool-call/tool-call.js +93 -55
- package/dist/browser/@patterninc/pattern-ui/dev-tools.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/en.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/es.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/fr.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/pl.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/pseudo-LOCALE.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/zh.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/reasoning-stepped.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/simple-provider.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/switch-control.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/switch-field.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/switch.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/thinking.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/tool-call.js +1 -1
- package/dist/browser/_chunks/{Switch-SlA81WxV.js → Switch-tFJ803kv.js} +1 -1
- package/dist/browser/_chunks/{SwitchControl-C2VB9_Bm.js → SwitchControl-C6o2IWP4.js} +1 -1
- package/dist/browser/_chunks/{messages-5m2Zo88A.js → messages-Cy4zXvjO.js} +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/locales/en/messages.js +1 -1
- package/dist/locales/es/messages.js +1 -1
- package/dist/locales/fr/messages.js +1 -1
- package/dist/locales/pl/messages.js +1 -1
- package/dist/locales/pseudo-LOCALE/messages.js +1 -1
- package/dist/locales/zh/messages.js +1 -1
- package/dist/play-cdn-claude.js +1 -1
- package/package.json +1 -1
- package/src/ai-elements/reasoning-stepped/reasoning-stepped.tsx +13 -3
- package/src/ai-elements/thinking/thinking.tsx +9 -12
- package/src/ai-elements/tool-call/tool-call-step.tsx +22 -8
- package/src/ai-elements/tool-call/tool-call-trigger.tsx +10 -5
- package/src/ai-elements/tool-call/tool-call.tsx +8 -11
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/locales/en/messages.po +3 -0
- package/src/locales/en/messages.ts +1 -1
- package/src/locales/es/messages.po +3 -0
- package/src/locales/es/messages.ts +1 -1
- package/src/locales/fr/messages.po +3 -0
- package/src/locales/fr/messages.ts +1 -1
- package/src/locales/pl/messages.po +3 -0
- package/src/locales/pl/messages.ts +1 -1
- package/src/locales/pseudo-LOCALE/messages.po +3 -0
- package/src/locales/pseudo-LOCALE/messages.ts +1 -1
- package/src/locales/zh/messages.po +3 -0
- package/src/locales/zh/messages.ts +1 -1
|
@@ -5,28 +5,46 @@ import { cn } from "cn";
|
|
|
5
5
|
|
|
6
6
|
//#region src/ai-elements/reasoning-stepped/reasoning-stepped.tsx
|
|
7
7
|
function ReasoningStepped(t0) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(9);
|
|
9
9
|
const { className, children, qaTestId: t1 } = t0;
|
|
10
10
|
const qaTestId = t1 === void 0 ? "reasoning-stepped" : t1;
|
|
11
11
|
let t2;
|
|
12
12
|
if ($[0] !== className) {
|
|
13
|
-
t2 = cn("
|
|
13
|
+
t2 = cn("relative", className);
|
|
14
14
|
$[0] = className;
|
|
15
15
|
$[1] = t2;
|
|
16
16
|
} else t2 = $[1];
|
|
17
17
|
let t3;
|
|
18
|
-
if ($[2]
|
|
18
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
19
19
|
t3 = /* @__PURE__ */ jsx("div", {
|
|
20
|
+
"aria-hidden": true,
|
|
21
|
+
className: "absolute top-3.5 bottom-0 left-3 w-[1.5px] -translate-x-1/2 rounded-full bg-border-soft",
|
|
22
|
+
"data-slot": "reasoning-spine"
|
|
23
|
+
});
|
|
24
|
+
$[2] = t3;
|
|
25
|
+
} else t3 = $[2];
|
|
26
|
+
let t4;
|
|
27
|
+
if ($[3] !== children) {
|
|
28
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: "relative flex flex-col gap-2",
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
$[3] = children;
|
|
33
|
+
$[4] = t4;
|
|
34
|
+
} else t4 = $[4];
|
|
35
|
+
let t5;
|
|
36
|
+
if ($[5] !== qaTestId || $[6] !== t2 || $[7] !== t4) {
|
|
37
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
20
38
|
className: t2,
|
|
21
39
|
"qa-test-id": qaTestId,
|
|
22
|
-
children
|
|
40
|
+
children: [t3, t4]
|
|
23
41
|
});
|
|
24
|
-
$[
|
|
25
|
-
$[
|
|
26
|
-
$[
|
|
27
|
-
$[
|
|
28
|
-
} else
|
|
29
|
-
return
|
|
42
|
+
$[5] = qaTestId;
|
|
43
|
+
$[6] = t2;
|
|
44
|
+
$[7] = t4;
|
|
45
|
+
$[8] = t5;
|
|
46
|
+
} else t5 = $[8];
|
|
47
|
+
return t5;
|
|
30
48
|
}
|
|
31
49
|
function ReasoningStep(t0) {
|
|
32
50
|
const $ = c(15);
|
|
@@ -50,7 +68,7 @@ function ReasoningStep(t0) {
|
|
|
50
68
|
t5 = /* @__PURE__ */ jsx(ReasoningTrigger, {
|
|
51
69
|
status,
|
|
52
70
|
headerText,
|
|
53
|
-
className: "py-1"
|
|
71
|
+
className: "w-full bg-base-inverse py-1"
|
|
54
72
|
});
|
|
55
73
|
$[4] = headerText;
|
|
56
74
|
$[5] = status;
|
|
@@ -7,6 +7,7 @@ import { useToggle } from "../../hooks/useToggle/useToggle.js";
|
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { createContext, useContext, useState } from "react";
|
|
10
|
+
import { useLingui } from "@lingui/react";
|
|
10
11
|
import { cn } from "cn";
|
|
11
12
|
import { motion } from "motion/react";
|
|
12
13
|
|
|
@@ -79,110 +80,133 @@ function Thinking(t0) {
|
|
|
79
80
|
}
|
|
80
81
|
/** ThinkingTrigger — Clickable trigger that shows the PI logo and timing text. */
|
|
81
82
|
function ThinkingTrigger(t0) {
|
|
82
|
-
const $ = c(
|
|
83
|
-
const { className, headerText
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
83
|
+
const $ = c(34);
|
|
84
|
+
const { className, headerText, isThinking: t1, qaTestId: t2 } = t0;
|
|
85
|
+
const isThinking = t1 === void 0 ? false : t1;
|
|
86
|
+
const qaTestId = t2 === void 0 ? "thinking-trigger" : t2;
|
|
87
|
+
const { _: _t } = useLingui();
|
|
87
88
|
const { isOpen, setIsOpen } = useThinking();
|
|
88
|
-
|
|
89
|
+
const labelColor = isOpen ? "text-text-sub" : "text-text-soft group-hover:text-text-sub";
|
|
90
|
+
let t3;
|
|
89
91
|
if ($[0] !== isOpen || $[1] !== setIsOpen) {
|
|
90
|
-
|
|
92
|
+
t3 = () => setIsOpen(!isOpen);
|
|
91
93
|
$[0] = isOpen;
|
|
92
94
|
$[1] = setIsOpen;
|
|
93
|
-
$[2] =
|
|
94
|
-
} else
|
|
95
|
-
let
|
|
95
|
+
$[2] = t3;
|
|
96
|
+
} else t3 = $[2];
|
|
97
|
+
let t4;
|
|
96
98
|
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
97
|
-
|
|
98
|
-
$[3] =
|
|
99
|
-
} else
|
|
100
|
-
let
|
|
99
|
+
t4 = { scale: .95 };
|
|
100
|
+
$[3] = t4;
|
|
101
|
+
} else t4 = $[3];
|
|
102
|
+
let t5;
|
|
101
103
|
if ($[4] !== className) {
|
|
102
|
-
|
|
104
|
+
t5 = cn("pui-text-body-medium-alt group flex items-center gap-2 transition-colors", "cursor-pointer border-none bg-transparent p-0", className);
|
|
103
105
|
$[4] = className;
|
|
104
|
-
$[5] =
|
|
105
|
-
} else
|
|
106
|
-
const
|
|
106
|
+
$[5] = t5;
|
|
107
|
+
} else t5 = $[5];
|
|
108
|
+
const t6 = useToggle("pi_long_chat_render_perf") ? void 0 : {
|
|
107
109
|
transform: "translate3d(0, 0, 0)",
|
|
108
110
|
backfaceVisibility: "hidden"
|
|
109
111
|
};
|
|
112
|
+
let t7;
|
|
113
|
+
if ($[6] !== labelColor) {
|
|
114
|
+
t7 = cn("transition-colors", labelColor);
|
|
115
|
+
$[6] = labelColor;
|
|
116
|
+
$[7] = t7;
|
|
117
|
+
} else t7 = $[7];
|
|
110
118
|
let t8;
|
|
111
|
-
if ($[
|
|
112
|
-
t8 = /* @__PURE__ */ jsx(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
isAnimating: isThinking,
|
|
116
|
-
size: 20
|
|
117
|
-
})
|
|
119
|
+
if ($[8] !== isThinking) {
|
|
120
|
+
t8 = /* @__PURE__ */ jsx(AnimatedLogoPI, {
|
|
121
|
+
isAnimating: isThinking,
|
|
122
|
+
size: 20
|
|
118
123
|
});
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
} else t8 = $[
|
|
124
|
+
$[8] = isThinking;
|
|
125
|
+
$[9] = t8;
|
|
126
|
+
} else t8 = $[9];
|
|
122
127
|
let t9;
|
|
123
|
-
if ($[
|
|
124
|
-
t9 =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
let t10;
|
|
128
|
-
if ($[9] !== headerText) {
|
|
129
|
-
t10 = /* @__PURE__ */ jsx("span", {
|
|
130
|
-
className: t9,
|
|
131
|
-
children: headerText
|
|
128
|
+
if ($[10] !== t7 || $[11] !== t8) {
|
|
129
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: t7,
|
|
131
|
+
children: t8
|
|
132
132
|
});
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
$[10] = t7;
|
|
134
|
+
$[11] = t8;
|
|
135
|
+
$[12] = t9;
|
|
136
|
+
} else t9 = $[12];
|
|
137
|
+
let t10;
|
|
138
|
+
if ($[13] !== labelColor) {
|
|
139
|
+
t10 = cn("pui-text-body-medium-compact transition-colors", labelColor);
|
|
140
|
+
$[13] = labelColor;
|
|
141
|
+
$[14] = t10;
|
|
142
|
+
} else t10 = $[14];
|
|
143
|
+
let t11;
|
|
144
|
+
if ($[15] !== _t || $[16] !== headerText) {
|
|
145
|
+
t11 = headerText ?? _t({ id: "-D6jVS" });
|
|
146
|
+
$[15] = _t;
|
|
147
|
+
$[16] = headerText;
|
|
148
|
+
$[17] = t11;
|
|
149
|
+
} else t11 = $[17];
|
|
137
150
|
let t12;
|
|
138
|
-
if ($[
|
|
139
|
-
t12 =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
if ($[18] !== t10 || $[19] !== t11) {
|
|
152
|
+
t12 = /* @__PURE__ */ jsx("span", {
|
|
153
|
+
className: t10,
|
|
154
|
+
children: t11
|
|
155
|
+
});
|
|
156
|
+
$[18] = t10;
|
|
157
|
+
$[19] = t11;
|
|
158
|
+
$[20] = t12;
|
|
159
|
+
} else t12 = $[20];
|
|
160
|
+
const t13 = isOpen ? "rotate-90" : "rotate-0";
|
|
161
|
+
let t14;
|
|
162
|
+
if ($[21] !== t13) {
|
|
163
|
+
t14 = cn("text-icon-soft transition-all duration-200 group-hover:text-icon-strong", t13);
|
|
164
|
+
$[21] = t13;
|
|
165
|
+
$[22] = t14;
|
|
166
|
+
} else t14 = $[22];
|
|
167
|
+
let t15;
|
|
168
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
169
|
+
t15 = /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
146
170
|
size: 20,
|
|
147
171
|
color: "currentColor"
|
|
148
172
|
});
|
|
149
|
-
$[
|
|
150
|
-
} else
|
|
151
|
-
let
|
|
152
|
-
if ($[
|
|
153
|
-
|
|
154
|
-
className:
|
|
155
|
-
children:
|
|
173
|
+
$[23] = t15;
|
|
174
|
+
} else t15 = $[23];
|
|
175
|
+
let t16;
|
|
176
|
+
if ($[24] !== t14) {
|
|
177
|
+
t16 = /* @__PURE__ */ jsx("div", {
|
|
178
|
+
className: t14,
|
|
179
|
+
children: t15
|
|
156
180
|
});
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else
|
|
160
|
-
let
|
|
161
|
-
if ($[
|
|
162
|
-
|
|
181
|
+
$[24] = t14;
|
|
182
|
+
$[25] = t16;
|
|
183
|
+
} else t16 = $[25];
|
|
184
|
+
let t17;
|
|
185
|
+
if ($[26] !== qaTestId || $[27] !== t12 || $[28] !== t16 || $[29] !== t3 || $[30] !== t5 || $[31] !== t6 || $[32] !== t9) {
|
|
186
|
+
t17 = /* @__PURE__ */ jsxs(motion.button, {
|
|
163
187
|
type: "button",
|
|
164
|
-
onClick:
|
|
165
|
-
whileTap:
|
|
188
|
+
onClick: t3,
|
|
189
|
+
whileTap: t4,
|
|
166
190
|
transition: springTransition,
|
|
167
|
-
className:
|
|
168
|
-
style:
|
|
191
|
+
className: t5,
|
|
192
|
+
style: t6,
|
|
169
193
|
"qa-test-id": qaTestId,
|
|
170
194
|
children: [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
195
|
+
t9,
|
|
196
|
+
t12,
|
|
197
|
+
t16
|
|
174
198
|
]
|
|
175
199
|
});
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
} else
|
|
185
|
-
return
|
|
200
|
+
$[26] = qaTestId;
|
|
201
|
+
$[27] = t12;
|
|
202
|
+
$[28] = t16;
|
|
203
|
+
$[29] = t3;
|
|
204
|
+
$[30] = t5;
|
|
205
|
+
$[31] = t6;
|
|
206
|
+
$[32] = t9;
|
|
207
|
+
$[33] = t17;
|
|
208
|
+
} else t17 = $[33];
|
|
209
|
+
return t17;
|
|
186
210
|
}
|
|
187
211
|
/** ThinkingContent — Animated expandable panel for thinking text and tags. */
|
|
188
212
|
function ThinkingContent(t0) {
|
|
@@ -228,7 +252,7 @@ function ThinkingContent(t0) {
|
|
|
228
252
|
className: "flex gap-2",
|
|
229
253
|
children: [/* @__PURE__ */ jsx("div", {
|
|
230
254
|
className: "flex w-6 items-center justify-center",
|
|
231
|
-
children: /* @__PURE__ */ jsx("div", { className: "h-full w-
|
|
255
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-full w-px rounded-full bg-depth-black-4" })
|
|
232
256
|
}), /* @__PURE__ */ jsxs("div", {
|
|
233
257
|
className: "flex-1 space-y-2",
|
|
234
258
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -247,7 +271,7 @@ function ThinkingContent(t0) {
|
|
|
247
271
|
if ($[7] !== contentRef || $[8] !== t9) {
|
|
248
272
|
t10 = /* @__PURE__ */ jsx("div", {
|
|
249
273
|
ref: contentRef,
|
|
250
|
-
className: "
|
|
274
|
+
className: "py-4",
|
|
251
275
|
children: t9
|
|
252
276
|
});
|
|
253
277
|
$[7] = contentRef;
|
|
@@ -5,9 +5,10 @@ import { useToggle } from "../../hooks/useToggle/useToggle.js";
|
|
|
5
5
|
import { ToolCallTrigger } from "./tool-call-trigger.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { useEffect, useRef, useState } from "react";
|
|
8
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
9
9
|
import { cn } from "cn";
|
|
10
10
|
import { motion } from "motion/react";
|
|
11
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
11
12
|
|
|
12
13
|
//#region src/ai-elements/tool-call/tool-call-step.tsx
|
|
13
14
|
/** Full trigger row (0–ICON_BOTTOM) is the gap; line only runs below trigger. */
|
|
@@ -45,7 +46,7 @@ function CurvedTailEnd(t0) {
|
|
|
45
46
|
let t3;
|
|
46
47
|
if ($[3] !== t1) {
|
|
47
48
|
t3 = /* @__PURE__ */ jsx("svg", {
|
|
48
|
-
className: "absolute z-0 overflow-visible text-
|
|
49
|
+
className: "absolute z-0 overflow-visible text-depth-black-4",
|
|
49
50
|
width: CURVE_SVG_WIDTH,
|
|
50
51
|
height: CURVE_VIEWBOX_HEIGHT,
|
|
51
52
|
viewBox: "0 0 13 38",
|
|
@@ -61,27 +62,75 @@ function CurvedTailEnd(t0) {
|
|
|
61
62
|
return t3;
|
|
62
63
|
}
|
|
63
64
|
function ToolCallStep(t0) {
|
|
64
|
-
const $ = c(
|
|
65
|
-
|
|
65
|
+
const $ = c(67);
|
|
66
|
+
let children;
|
|
67
|
+
let className;
|
|
68
|
+
let forwardedRef;
|
|
69
|
+
let headerText;
|
|
70
|
+
let onSuffixClick;
|
|
71
|
+
let prefixProps;
|
|
72
|
+
let props;
|
|
73
|
+
let status;
|
|
74
|
+
let suffixAriaLabel;
|
|
75
|
+
let suffixProps;
|
|
76
|
+
let t1;
|
|
77
|
+
let t2;
|
|
78
|
+
let t3;
|
|
79
|
+
let t4;
|
|
80
|
+
if ($[0] !== t0) {
|
|
81
|
+
({className, status, headerText, suffixProps, onSuffixClick, suffixAriaLabel, prefixProps, tags: t1, children, defaultOpen: t2, _isLast: t3, qaTestId: t4, ref: forwardedRef, ...props} = t0);
|
|
82
|
+
$[0] = t0;
|
|
83
|
+
$[1] = children;
|
|
84
|
+
$[2] = className;
|
|
85
|
+
$[3] = forwardedRef;
|
|
86
|
+
$[4] = headerText;
|
|
87
|
+
$[5] = onSuffixClick;
|
|
88
|
+
$[6] = prefixProps;
|
|
89
|
+
$[7] = props;
|
|
90
|
+
$[8] = status;
|
|
91
|
+
$[9] = suffixAriaLabel;
|
|
92
|
+
$[10] = suffixProps;
|
|
93
|
+
$[11] = t1;
|
|
94
|
+
$[12] = t2;
|
|
95
|
+
$[13] = t3;
|
|
96
|
+
$[14] = t4;
|
|
97
|
+
} else {
|
|
98
|
+
children = $[1];
|
|
99
|
+
className = $[2];
|
|
100
|
+
forwardedRef = $[3];
|
|
101
|
+
headerText = $[4];
|
|
102
|
+
onSuffixClick = $[5];
|
|
103
|
+
prefixProps = $[6];
|
|
104
|
+
props = $[7];
|
|
105
|
+
status = $[8];
|
|
106
|
+
suffixAriaLabel = $[9];
|
|
107
|
+
suffixProps = $[10];
|
|
108
|
+
t1 = $[11];
|
|
109
|
+
t2 = $[12];
|
|
110
|
+
t3 = $[13];
|
|
111
|
+
t4 = $[14];
|
|
112
|
+
}
|
|
66
113
|
let t5;
|
|
67
|
-
if ($[
|
|
114
|
+
if ($[15] !== t1) {
|
|
68
115
|
t5 = t1 === void 0 ? [] : t1;
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
} else t5 = $[
|
|
116
|
+
$[15] = t1;
|
|
117
|
+
$[16] = t5;
|
|
118
|
+
} else t5 = $[16];
|
|
72
119
|
const tags = t5;
|
|
73
120
|
const defaultOpen = t2 === void 0 ? false : t2;
|
|
74
121
|
const _isLast = t3 === void 0 ? true : t3;
|
|
75
122
|
const qaTestId = t4 === void 0 ? "tool-call-step" : t4;
|
|
123
|
+
const contentId = useId();
|
|
76
124
|
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
77
125
|
const [hasOpened, setHasOpened] = useState(defaultOpen);
|
|
78
126
|
if (isOpen && !hasOpened) setHasOpened(true);
|
|
79
127
|
const { contentRef, measuredHeight } = useExpandableHeight();
|
|
80
128
|
const stepRef = useRef(null);
|
|
129
|
+
const composedRef = useComposedRefs(forwardedRef, stepRef);
|
|
81
130
|
const [straightHeight, setStraightHeight] = useState(0);
|
|
82
131
|
const [tailTop, setTailTop] = useState(TRIGGER_ROW_GAP);
|
|
83
132
|
let t6;
|
|
84
|
-
if ($[
|
|
133
|
+
if ($[17] !== _isLast || $[18] !== contentRef || $[19] !== isOpen) {
|
|
85
134
|
t6 = () => {
|
|
86
135
|
if (!isOpen || !_isLast) return;
|
|
87
136
|
if (typeof ResizeObserver === "undefined") return;
|
|
@@ -103,64 +152,64 @@ function ToolCallStep(t0) {
|
|
|
103
152
|
observer.disconnect();
|
|
104
153
|
};
|
|
105
154
|
};
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
} else t6 = $[
|
|
155
|
+
$[17] = _isLast;
|
|
156
|
+
$[18] = contentRef;
|
|
157
|
+
$[19] = isOpen;
|
|
158
|
+
$[20] = t6;
|
|
159
|
+
} else t6 = $[20];
|
|
111
160
|
let t7;
|
|
112
|
-
if ($[
|
|
161
|
+
if ($[21] !== _isLast || $[22] !== contentRef || $[23] !== isOpen || $[24] !== measuredHeight) {
|
|
113
162
|
t7 = [
|
|
114
163
|
_isLast,
|
|
115
164
|
contentRef,
|
|
116
165
|
isOpen,
|
|
117
166
|
measuredHeight
|
|
118
167
|
];
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
} else t7 = $[
|
|
168
|
+
$[21] = _isLast;
|
|
169
|
+
$[22] = contentRef;
|
|
170
|
+
$[23] = isOpen;
|
|
171
|
+
$[24] = measuredHeight;
|
|
172
|
+
$[25] = t7;
|
|
173
|
+
} else t7 = $[25];
|
|
125
174
|
useEffect(t6, t7);
|
|
126
175
|
const showLineBelow = !_isLast;
|
|
127
176
|
const showCurve = _isLast && isOpen;
|
|
128
177
|
const t8 = isOpen ? measuredHeight : 0;
|
|
129
178
|
const t9 = isOpen ? 1 : 0;
|
|
130
179
|
let t10;
|
|
131
|
-
if ($[
|
|
180
|
+
if ($[26] !== t8 || $[27] !== t9) {
|
|
132
181
|
t10 = {
|
|
133
182
|
height: t8,
|
|
134
183
|
opacity: t9
|
|
135
184
|
};
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
} else t10 = $[
|
|
185
|
+
$[26] = t8;
|
|
186
|
+
$[27] = t9;
|
|
187
|
+
$[28] = t10;
|
|
188
|
+
} else t10 = $[28];
|
|
140
189
|
const contentAnimationValues = t10;
|
|
141
190
|
let t11;
|
|
142
|
-
if ($[
|
|
191
|
+
if ($[29] !== className) {
|
|
143
192
|
t11 = cn("group/step relative", className);
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
} else t11 = $[
|
|
193
|
+
$[29] = className;
|
|
194
|
+
$[30] = t11;
|
|
195
|
+
} else t11 = $[30];
|
|
147
196
|
let t12;
|
|
148
|
-
if ($[
|
|
197
|
+
if ($[31] !== showLineBelow) {
|
|
149
198
|
t12 = showLineBelow ? /* @__PURE__ */ jsx("div", {
|
|
150
|
-
className: "absolute bottom-0 z-0 w-px bg-
|
|
199
|
+
className: "absolute bottom-0 z-0 w-px bg-depth-black-4",
|
|
151
200
|
style: {
|
|
152
201
|
left: 11.5,
|
|
153
202
|
top: TRIGGER_ROW_GAP
|
|
154
203
|
},
|
|
155
204
|
"aria-hidden": true
|
|
156
205
|
}) : null;
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else t12 = $[
|
|
206
|
+
$[31] = showLineBelow;
|
|
207
|
+
$[32] = t12;
|
|
208
|
+
} else t12 = $[32];
|
|
160
209
|
let t13;
|
|
161
|
-
if ($[
|
|
210
|
+
if ($[33] !== showCurve || $[34] !== straightHeight || $[35] !== tailTop) {
|
|
162
211
|
t13 = showCurve ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
163
|
-
className: "absolute z-0 w-px bg-
|
|
212
|
+
className: "absolute z-0 w-px bg-depth-black-4",
|
|
164
213
|
style: {
|
|
165
214
|
left: 11.5,
|
|
166
215
|
top: TRIGGER_ROW_GAP,
|
|
@@ -168,19 +217,19 @@ function ToolCallStep(t0) {
|
|
|
168
217
|
},
|
|
169
218
|
"aria-hidden": true
|
|
170
219
|
}), /* @__PURE__ */ jsx(CurvedTailEnd, { top: tailTop })] }) : null;
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
} else t13 = $[
|
|
220
|
+
$[33] = showCurve;
|
|
221
|
+
$[34] = straightHeight;
|
|
222
|
+
$[35] = tailTop;
|
|
223
|
+
$[36] = t13;
|
|
224
|
+
} else t13 = $[36];
|
|
176
225
|
let t14;
|
|
177
|
-
if ($[
|
|
226
|
+
if ($[37] !== isOpen) {
|
|
178
227
|
t14 = () => setIsOpen(!isOpen);
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
} else t14 = $[
|
|
228
|
+
$[37] = isOpen;
|
|
229
|
+
$[38] = t14;
|
|
230
|
+
} else t14 = $[38];
|
|
182
231
|
let t15;
|
|
183
|
-
if ($[
|
|
232
|
+
if ($[39] !== contentId || $[40] !== headerText || $[41] !== isOpen || $[42] !== onSuffixClick || $[43] !== prefixProps || $[44] !== status || $[45] !== suffixAriaLabel || $[46] !== suffixProps || $[47] !== t14) {
|
|
184
233
|
t15 = /* @__PURE__ */ jsx(ToolCallTrigger, {
|
|
185
234
|
status,
|
|
186
235
|
headerText,
|
|
@@ -189,25 +238,28 @@ function ToolCallStep(t0) {
|
|
|
189
238
|
suffixAriaLabel,
|
|
190
239
|
prefixProps,
|
|
191
240
|
isOpen,
|
|
241
|
+
contentId,
|
|
192
242
|
onClick: t14,
|
|
193
243
|
className: "relative z-10 h-8"
|
|
194
244
|
});
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
|
|
205
|
-
|
|
245
|
+
$[39] = contentId;
|
|
246
|
+
$[40] = headerText;
|
|
247
|
+
$[41] = isOpen;
|
|
248
|
+
$[42] = onSuffixClick;
|
|
249
|
+
$[43] = prefixProps;
|
|
250
|
+
$[44] = status;
|
|
251
|
+
$[45] = suffixAriaLabel;
|
|
252
|
+
$[46] = suffixProps;
|
|
253
|
+
$[47] = t14;
|
|
254
|
+
$[48] = t15;
|
|
255
|
+
} else t15 = $[48];
|
|
256
|
+
const t16 = !isOpen;
|
|
257
|
+
const t17 = useToggle("pi_long_chat_render_perf") ? void 0 : {
|
|
206
258
|
willChange: "height, opacity",
|
|
207
259
|
transform: "translate3d(0, 0, 0)",
|
|
208
260
|
backfaceVisibility: "hidden"
|
|
209
261
|
};
|
|
210
|
-
const
|
|
262
|
+
const t18 = !useToggle("pi_long_chat_render_perf") || hasOpened ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
211
263
|
className: "py-1",
|
|
212
264
|
children: /* @__PURE__ */ jsx("div", {
|
|
213
265
|
className: cn("pui-text-body-medium-compact text-text-soft", "wrap-break-word whitespace-pre-wrap"),
|
|
@@ -217,54 +269,61 @@ function ToolCallStep(t0) {
|
|
|
217
269
|
className: "flex flex-wrap gap-2 py-1",
|
|
218
270
|
children: tags.map(_temp)
|
|
219
271
|
}) : null] }) : null;
|
|
220
|
-
let
|
|
221
|
-
if ($[
|
|
222
|
-
|
|
272
|
+
let t19;
|
|
273
|
+
if ($[49] !== contentRef || $[50] !== t18) {
|
|
274
|
+
t19 = /* @__PURE__ */ jsx("div", {
|
|
223
275
|
ref: contentRef,
|
|
224
276
|
className: "pt-1 pb-1 pl-8",
|
|
225
|
-
children:
|
|
277
|
+
children: t18
|
|
226
278
|
});
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
} else
|
|
231
|
-
let
|
|
232
|
-
if ($[
|
|
233
|
-
|
|
279
|
+
$[49] = contentRef;
|
|
280
|
+
$[50] = t18;
|
|
281
|
+
$[51] = t19;
|
|
282
|
+
} else t19 = $[51];
|
|
283
|
+
let t20;
|
|
284
|
+
if ($[52] !== contentAnimationValues || $[53] !== contentId || $[54] !== t16 || $[55] !== t17 || $[56] !== t19) {
|
|
285
|
+
t20 = /* @__PURE__ */ jsx(motion.div, {
|
|
286
|
+
id: contentId,
|
|
287
|
+
inert: t16,
|
|
234
288
|
initial: contentAnimationValues,
|
|
235
289
|
animate: contentAnimationValues,
|
|
236
290
|
transition: panelTransition,
|
|
237
291
|
className: "w-full overflow-hidden",
|
|
238
|
-
style:
|
|
239
|
-
children:
|
|
292
|
+
style: t17,
|
|
293
|
+
children: t19
|
|
240
294
|
});
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
295
|
+
$[52] = contentAnimationValues;
|
|
296
|
+
$[53] = contentId;
|
|
297
|
+
$[54] = t16;
|
|
298
|
+
$[55] = t17;
|
|
299
|
+
$[56] = t19;
|
|
300
|
+
$[57] = t20;
|
|
301
|
+
} else t20 = $[57];
|
|
302
|
+
let t21;
|
|
303
|
+
if ($[58] !== composedRef || $[59] !== props || $[60] !== qaTestId || $[61] !== t11 || $[62] !== t12 || $[63] !== t13 || $[64] !== t15 || $[65] !== t20) {
|
|
304
|
+
t21 = /* @__PURE__ */ jsxs("div", {
|
|
305
|
+
...props,
|
|
306
|
+
ref: composedRef,
|
|
250
307
|
className: t11,
|
|
251
308
|
"qa-test-id": qaTestId,
|
|
252
309
|
children: [
|
|
253
310
|
t12,
|
|
254
311
|
t13,
|
|
255
312
|
t15,
|
|
256
|
-
|
|
313
|
+
t20
|
|
257
314
|
]
|
|
258
315
|
});
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
|
|
267
|
-
|
|
316
|
+
$[58] = composedRef;
|
|
317
|
+
$[59] = props;
|
|
318
|
+
$[60] = qaTestId;
|
|
319
|
+
$[61] = t11;
|
|
320
|
+
$[62] = t12;
|
|
321
|
+
$[63] = t13;
|
|
322
|
+
$[64] = t15;
|
|
323
|
+
$[65] = t20;
|
|
324
|
+
$[66] = t21;
|
|
325
|
+
} else t21 = $[66];
|
|
326
|
+
return t21;
|
|
268
327
|
}
|
|
269
328
|
function _temp(tag, index) {
|
|
270
329
|
return /* @__PURE__ */ jsx(Tag, {
|