llmasaservice-ui 0.16.13 → 0.16.14

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.css CHANGED
@@ -877,6 +877,29 @@
877
877
  line-height: 1.4;
878
878
  white-space: pre-wrap;
879
879
  }
880
+ .thinking-content-collapsed {
881
+ display: -webkit-box;
882
+ -webkit-line-clamp: 2;
883
+ -webkit-box-orient: vertical;
884
+ overflow: hidden;
885
+ text-overflow: ellipsis;
886
+ }
887
+ .thinking-content-expanded {
888
+ }
889
+ .thinking-expand-btn {
890
+ background: none;
891
+ border: none;
892
+ cursor: pointer;
893
+ color: var(--title-text-color);
894
+ font-size: 0.75rem;
895
+ padding: 2px 4px;
896
+ margin-top: 2px;
897
+ opacity: 0.7;
898
+ align-self: flex-start;
899
+ }
900
+ .thinking-expand-btn:hover {
901
+ opacity: 1;
902
+ }
880
903
  button[data-pending=true] {
881
904
  opacity: 0.55;
882
905
  pointer-events: none;
package/dist/index.js CHANGED
@@ -261,6 +261,7 @@ var ChatPanel = ({
261
261
  const [alwaysApprovedTools, setAlwaysApprovedTools] = (0, import_react3.useState)([]);
262
262
  const [thinkingBlocks, setThinkingBlocks] = (0, import_react3.useState)([]);
263
263
  const [currentThinkingIndex, setCurrentThinkingIndex] = (0, import_react3.useState)(0);
264
+ const [thinkingExpanded, setThinkingExpanded] = (0, import_react3.useState)(false);
264
265
  const [userResizedHeight, setUserResizedHeight] = (0, import_react3.useState)(null);
265
266
  const [pendingButtonAttachments, setPendingButtonAttachments] = (0, import_react3.useState)([]);
266
267
  const actionMatchRegistry = (0, import_react3.useRef)(/* @__PURE__ */ new Map());
@@ -438,8 +439,16 @@ var ChatPanel = ({
438
439
  className: "thinking-nav-btn"
439
440
  },
440
441
  "\u2192"
441
- ))), /* @__PURE__ */ import_react3.default.createElement("div", { className: "thinking-content" }, content)));
442
- }, [thinkingBlocks, currentThinkingIndex]);
442
+ ))), /* @__PURE__ */ import_react3.default.createElement("div", { className: `thinking-content ${thinkingExpanded ? "thinking-content-expanded" : "thinking-content-collapsed"}` }, content), /* @__PURE__ */ import_react3.default.createElement(
443
+ "button",
444
+ {
445
+ className: "thinking-expand-btn",
446
+ onClick: () => setThinkingExpanded((prev) => !prev),
447
+ title: thinkingExpanded ? "Collapse" : "Expand"
448
+ },
449
+ thinkingExpanded ? "\u25B2" : "\u25BC"
450
+ )));
451
+ }, [thinkingBlocks, currentThinkingIndex, thinkingExpanded]);
443
452
  const getBrowserInfo = () => {
444
453
  try {
445
454
  return {
package/dist/index.mjs CHANGED
@@ -233,6 +233,7 @@ var ChatPanel = ({
233
233
  const [alwaysApprovedTools, setAlwaysApprovedTools] = useState2([]);
234
234
  const [thinkingBlocks, setThinkingBlocks] = useState2([]);
235
235
  const [currentThinkingIndex, setCurrentThinkingIndex] = useState2(0);
236
+ const [thinkingExpanded, setThinkingExpanded] = useState2(false);
236
237
  const [userResizedHeight, setUserResizedHeight] = useState2(null);
237
238
  const [pendingButtonAttachments, setPendingButtonAttachments] = useState2([]);
238
239
  const actionMatchRegistry = useRef(/* @__PURE__ */ new Map());
@@ -410,8 +411,16 @@ var ChatPanel = ({
410
411
  className: "thinking-nav-btn"
411
412
  },
412
413
  "\u2192"
413
- ))), /* @__PURE__ */ React3.createElement("div", { className: "thinking-content" }, content)));
414
- }, [thinkingBlocks, currentThinkingIndex]);
414
+ ))), /* @__PURE__ */ React3.createElement("div", { className: `thinking-content ${thinkingExpanded ? "thinking-content-expanded" : "thinking-content-collapsed"}` }, content), /* @__PURE__ */ React3.createElement(
415
+ "button",
416
+ {
417
+ className: "thinking-expand-btn",
418
+ onClick: () => setThinkingExpanded((prev) => !prev),
419
+ title: thinkingExpanded ? "Collapse" : "Expand"
420
+ },
421
+ thinkingExpanded ? "\u25B2" : "\u25BC"
422
+ )));
423
+ }, [thinkingBlocks, currentThinkingIndex, thinkingExpanded]);
415
424
  const getBrowserInfo = () => {
416
425
  try {
417
426
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.16.13",
3
+ "version": "0.16.14",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/ChatPanel.css CHANGED
@@ -1068,6 +1068,34 @@
1068
1068
  white-space: pre-wrap;
1069
1069
  }
1070
1070
 
1071
+ .thinking-content-collapsed {
1072
+ display: -webkit-box;
1073
+ -webkit-line-clamp: 2;
1074
+ -webkit-box-orient: vertical;
1075
+ overflow: hidden;
1076
+ text-overflow: ellipsis;
1077
+ }
1078
+
1079
+ .thinking-content-expanded {
1080
+ /* show all content */
1081
+ }
1082
+
1083
+ .thinking-expand-btn {
1084
+ background: none;
1085
+ border: none;
1086
+ cursor: pointer;
1087
+ color: var(--title-text-color);
1088
+ font-size: 0.75rem;
1089
+ padding: 2px 4px;
1090
+ margin-top: 2px;
1091
+ opacity: 0.7;
1092
+ align-self: flex-start;
1093
+ }
1094
+
1095
+ .thinking-expand-btn:hover {
1096
+ opacity: 1;
1097
+ }
1098
+
1071
1099
  /* Progressive action placeholder buttons */
1072
1100
  button[data-pending="true"] {
1073
1101
  opacity: 0.55;
package/src/ChatPanel.tsx CHANGED
@@ -220,6 +220,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
220
220
  Array<{ type: "reasoning" | "searching"; content: string; index: number }>
221
221
  >([]);
222
222
  const [currentThinkingIndex, setCurrentThinkingIndex] = useState(0);
223
+ const [thinkingExpanded, setThinkingExpanded] = useState(false);
223
224
 
224
225
  // State for tracking user-resized textarea height
225
226
  const [userResizedHeight, setUserResizedHeight] = useState<number | null>(null);
@@ -510,11 +511,20 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
510
511
  </div>
511
512
  )}
512
513
  </div>
513
- <div className="thinking-content">{content}</div>
514
+ <div className={`thinking-content ${thinkingExpanded ? 'thinking-content-expanded' : 'thinking-content-collapsed'}`}>
515
+ {content}
516
+ </div>
517
+ <button
518
+ className="thinking-expand-btn"
519
+ onClick={() => setThinkingExpanded((prev) => !prev)}
520
+ title={thinkingExpanded ? "Collapse" : "Expand"}
521
+ >
522
+ {thinkingExpanded ? "▲" : "▼"}
523
+ </button>
514
524
  </div>
515
525
  </div>
516
526
  );
517
- }, [thinkingBlocks, currentThinkingIndex]);
527
+ }, [thinkingBlocks, currentThinkingIndex, thinkingExpanded]);
518
528
 
519
529
  const getBrowserInfo = () => {
520
530
  try {