@tangle-network/agent-app 3.0.2 → 3.0.3
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/assistant/index.js +15 -90
- package/dist/assistant/index.js.map +1 -1
- package/dist/{chunk-5WQ77MPN.js → chunk-NN3CQNX5.js} +786 -719
- package/dist/chunk-NN3CQNX5.js.map +1 -0
- package/dist/web-react/index.d.ts +1 -0
- package/dist/web-react/index.js +3 -1
- package/dist/web-react/resize-handle.d.ts +24 -0
- package/package.json +1 -1
- package/dist/assistant/ResizeHandle.d.ts +0 -19
- package/dist/chunk-5WQ77MPN.js.map +0 -1
package/dist/assistant/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReasoningRow,
|
|
3
|
+
ResizeHandle,
|
|
3
4
|
chatToolCallPart,
|
|
4
5
|
resolveToolPresentation
|
|
5
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-NN3CQNX5.js";
|
|
6
7
|
import "../chunk-UHSUY6H6.js";
|
|
7
8
|
import "../chunk-3HUFJ5LO.js";
|
|
8
9
|
import "../chunk-7PULOECS.js";
|
|
@@ -1853,7 +1854,7 @@ function useAssistantThreads(userId) {
|
|
|
1853
1854
|
// src/assistant/AssistantDock.tsx
|
|
1854
1855
|
import {
|
|
1855
1856
|
useEffect as useEffect8,
|
|
1856
|
-
useRef as
|
|
1857
|
+
useRef as useRef8
|
|
1857
1858
|
} from "react";
|
|
1858
1859
|
|
|
1859
1860
|
// src/assistant/AssistantPanel.tsx
|
|
@@ -3314,86 +3315,8 @@ function AssistantPanelHeader({
|
|
|
3314
3315
|
] });
|
|
3315
3316
|
}
|
|
3316
3317
|
|
|
3317
|
-
// src/assistant/ResizeHandle.tsx
|
|
3318
|
-
import { useRef as useRef8 } from "react";
|
|
3319
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3320
|
-
function ResizeHandle({
|
|
3321
|
-
width,
|
|
3322
|
-
maxWidth,
|
|
3323
|
-
onPreview,
|
|
3324
|
-
onCommit,
|
|
3325
|
-
onNudge
|
|
3326
|
-
}) {
|
|
3327
|
-
const dragRef = useRef8(null);
|
|
3328
|
-
const onPointerDown = (e) => {
|
|
3329
|
-
if (e.button !== 0) return;
|
|
3330
|
-
e.preventDefault();
|
|
3331
|
-
e.currentTarget.setPointerCapture(e.pointerId);
|
|
3332
|
-
dragRef.current = {
|
|
3333
|
-
startX: e.clientX,
|
|
3334
|
-
startWidth: width,
|
|
3335
|
-
lastWidth: width
|
|
3336
|
-
};
|
|
3337
|
-
};
|
|
3338
|
-
const onPointerMove = (e) => {
|
|
3339
|
-
const drag = dragRef.current;
|
|
3340
|
-
if (!drag) return;
|
|
3341
|
-
const next = drag.startWidth + (drag.startX - e.clientX);
|
|
3342
|
-
if (Math.abs(next - drag.lastWidth) < 1) return;
|
|
3343
|
-
drag.lastWidth = next;
|
|
3344
|
-
onPreview(next);
|
|
3345
|
-
};
|
|
3346
|
-
const endDrag = (e) => {
|
|
3347
|
-
const drag = dragRef.current;
|
|
3348
|
-
if (!drag) return;
|
|
3349
|
-
dragRef.current = null;
|
|
3350
|
-
if (e.currentTarget.hasPointerCapture(e.pointerId)) {
|
|
3351
|
-
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
3352
|
-
}
|
|
3353
|
-
onCommit(drag.lastWidth);
|
|
3354
|
-
};
|
|
3355
|
-
const onKeyDown = (e) => {
|
|
3356
|
-
const STEP = 24;
|
|
3357
|
-
if (e.key === "ArrowLeft") {
|
|
3358
|
-
e.preventDefault();
|
|
3359
|
-
onNudge(STEP);
|
|
3360
|
-
} else if (e.key === "ArrowRight") {
|
|
3361
|
-
e.preventDefault();
|
|
3362
|
-
onNudge(-STEP);
|
|
3363
|
-
}
|
|
3364
|
-
};
|
|
3365
|
-
return (
|
|
3366
|
-
// biome-ignore lint/a11y/useSemanticElements: a focusable drag handle is an ARIA window-splitter (role=separator); no native HTML element provides this.
|
|
3367
|
-
/* @__PURE__ */ jsx8(
|
|
3368
|
-
"div",
|
|
3369
|
-
{
|
|
3370
|
-
role: "separator",
|
|
3371
|
-
"aria-orientation": "vertical",
|
|
3372
|
-
"aria-label": "Resize assistant panel",
|
|
3373
|
-
"aria-valuemin": MIN_PANEL_WIDTH,
|
|
3374
|
-
"aria-valuemax": maxWidth,
|
|
3375
|
-
"aria-valuenow": width,
|
|
3376
|
-
tabIndex: 0,
|
|
3377
|
-
onPointerDown,
|
|
3378
|
-
onPointerMove,
|
|
3379
|
-
onPointerUp: endDrag,
|
|
3380
|
-
onPointerCancel: endDrag,
|
|
3381
|
-
onKeyDown,
|
|
3382
|
-
className: "group absolute inset-y-0 left-0 z-10 flex w-2 -translate-x-1/2 cursor-ew-resize touch-none items-center justify-center",
|
|
3383
|
-
children: /* @__PURE__ */ jsx8(
|
|
3384
|
-
"span",
|
|
3385
|
-
{
|
|
3386
|
-
"aria-hidden": "true",
|
|
3387
|
-
className: "h-10 w-1 rounded-full bg-border transition-colors group-hover:bg-primary group-focus:bg-primary"
|
|
3388
|
-
}
|
|
3389
|
-
)
|
|
3390
|
-
}
|
|
3391
|
-
)
|
|
3392
|
-
);
|
|
3393
|
-
}
|
|
3394
|
-
|
|
3395
3318
|
// src/assistant/AssistantDock.tsx
|
|
3396
|
-
import { Fragment as Fragment2, jsx as
|
|
3319
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3397
3320
|
function focusableWithin(container) {
|
|
3398
3321
|
const selector = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
3399
3322
|
return Array.from(container.querySelectorAll(selector)).filter(
|
|
@@ -3439,10 +3362,10 @@ function AssistantDock({
|
|
|
3439
3362
|
onConnectRequirement,
|
|
3440
3363
|
context
|
|
3441
3364
|
});
|
|
3442
|
-
const panelRef =
|
|
3443
|
-
const toggleRef =
|
|
3444
|
-
const returnFocusRef =
|
|
3445
|
-
const wasOpenRef =
|
|
3365
|
+
const panelRef = useRef8(null);
|
|
3366
|
+
const toggleRef = useRef8(null);
|
|
3367
|
+
const returnFocusRef = useRef8(null);
|
|
3368
|
+
const wasOpenRef = useRef8(false);
|
|
3446
3369
|
const sheet = layout === "sheet";
|
|
3447
3370
|
useEffect8(() => {
|
|
3448
3371
|
const onKeyDown = (e) => {
|
|
@@ -3487,7 +3410,7 @@ function AssistantDock({
|
|
|
3487
3410
|
}
|
|
3488
3411
|
}, [open, openedOnLoad]);
|
|
3489
3412
|
if (!open) {
|
|
3490
|
-
return floatingToggle ? /* @__PURE__ */
|
|
3413
|
+
return floatingToggle ? /* @__PURE__ */ jsx8(
|
|
3491
3414
|
AssistantPanelToggle,
|
|
3492
3415
|
{
|
|
3493
3416
|
buttonRef: toggleRef,
|
|
@@ -3524,7 +3447,7 @@ function AssistantDock({
|
|
|
3524
3447
|
first.focus();
|
|
3525
3448
|
}
|
|
3526
3449
|
};
|
|
3527
|
-
const panel = /* @__PURE__ */
|
|
3450
|
+
const panel = /* @__PURE__ */ jsx8(
|
|
3528
3451
|
AssistantPanel,
|
|
3529
3452
|
{
|
|
3530
3453
|
chat,
|
|
@@ -3549,7 +3472,7 @@ function AssistantDock({
|
|
|
3549
3472
|
);
|
|
3550
3473
|
if (sheet) {
|
|
3551
3474
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
3552
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ jsx8(
|
|
3553
3476
|
"div",
|
|
3554
3477
|
{
|
|
3555
3478
|
"aria-hidden": "true",
|
|
@@ -3557,7 +3480,7 @@ function AssistantDock({
|
|
|
3557
3480
|
onClick: closeAssistant
|
|
3558
3481
|
}
|
|
3559
3482
|
),
|
|
3560
|
-
/* @__PURE__ */
|
|
3483
|
+
/* @__PURE__ */ jsx8(
|
|
3561
3484
|
"div",
|
|
3562
3485
|
{
|
|
3563
3486
|
ref: panelRef,
|
|
@@ -3585,10 +3508,12 @@ function AssistantDock({
|
|
|
3585
3508
|
className: "fixed inset-y-0 right-0 z-30 flex flex-col border-border border-l focus:outline-none",
|
|
3586
3509
|
children: [
|
|
3587
3510
|
panel,
|
|
3588
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsx8(
|
|
3589
3512
|
ResizeHandle,
|
|
3590
3513
|
{
|
|
3514
|
+
label: "Resize assistant panel",
|
|
3591
3515
|
width,
|
|
3516
|
+
minWidth: MIN_PANEL_WIDTH,
|
|
3592
3517
|
maxWidth,
|
|
3593
3518
|
onPreview: previewWidth,
|
|
3594
3519
|
onCommit: setWidth,
|