@superinterface/react 2.11.0 → 2.13.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.cjs +153 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +147 -96
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3359,6 +3359,7 @@ var Root8 = function(param) {
|
|
|
3359
3359
|
});
|
|
3360
3360
|
};
|
|
3361
3361
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
3362
|
+
var import_react44 = require("react");
|
|
3362
3363
|
var import_themes43 = require("@radix-ui/themes");
|
|
3363
3364
|
// src/hooks/threads/useAudioThreadContext/index.ts
|
|
3364
3365
|
var import_react42 = require("react");
|
|
@@ -3433,97 +3434,158 @@ var BarsVisualizer = function(param) {
|
|
|
3433
3434
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3434
3435
|
var Visualization = function() {
|
|
3435
3436
|
var audioThreadContext = useAudioThreadContext();
|
|
3436
|
-
|
|
3437
|
+
var assistantNameContext = (0, import_react44.useContext)(AssistantNameContext);
|
|
3438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_themes43.Flex, {
|
|
3437
3439
|
direction: "column",
|
|
3438
3440
|
align: "center",
|
|
3439
3441
|
justify: "center",
|
|
3440
3442
|
mb: "3",
|
|
3441
3443
|
flexGrow: "1",
|
|
3442
|
-
children:
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3444
|
+
children: [
|
|
3445
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_themes43.Flex, {
|
|
3446
|
+
align: "center",
|
|
3447
|
+
justify: "center",
|
|
3448
|
+
height: "200px",
|
|
3449
|
+
width: "200px",
|
|
3450
|
+
style: {
|
|
3451
|
+
backgroundColor: audioThreadContext.status === "playing" ? "var(--accent-4)" : "var(--gray-4)",
|
|
3452
|
+
borderRadius: "9999px"
|
|
3453
|
+
},
|
|
3454
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BarsVisualizer, {
|
|
3455
|
+
visualizationAnalyser: audioThreadContext.messageAudioProps.visualizationAnalyser,
|
|
3456
|
+
backgroundColor: audioThreadContext.status === "playing" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3457
|
+
height: "40px",
|
|
3458
|
+
barWidth: "24px"
|
|
3459
|
+
})
|
|
3460
|
+
}),
|
|
3461
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_themes43.Flex, {
|
|
3462
|
+
ml: "-22.5px",
|
|
3463
|
+
gap: "3",
|
|
3464
|
+
pt: "5",
|
|
3465
|
+
children: [
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(AssistantAvatar, {}),
|
|
3467
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Name, {
|
|
3468
|
+
children: assistantNameContext
|
|
3469
|
+
})
|
|
3470
|
+
]
|
|
3456
3471
|
})
|
|
3472
|
+
]
|
|
3473
|
+
});
|
|
3474
|
+
};
|
|
3475
|
+
// src/components/threads/AudioThread/Status/StatusMessage.tsx
|
|
3476
|
+
var import_themes44 = require("@radix-ui/themes");
|
|
3477
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3478
|
+
var StatusMessage = function(param) {
|
|
3479
|
+
var children = param.children;
|
|
3480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_themes44.Flex, {
|
|
3481
|
+
justify: "center",
|
|
3482
|
+
pb: "9",
|
|
3483
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_themes44.Text, {
|
|
3484
|
+
size: "2",
|
|
3485
|
+
weight: "regular",
|
|
3486
|
+
color: "gray",
|
|
3487
|
+
children: children
|
|
3457
3488
|
})
|
|
3458
3489
|
});
|
|
3459
3490
|
};
|
|
3491
|
+
// src/components/threads/AudioThread/Status/index.tsx
|
|
3492
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3493
|
+
var Status = function() {
|
|
3494
|
+
var audioThreadContext = useAudioThreadContext();
|
|
3495
|
+
if (audioThreadContext.status === "recording") {
|
|
3496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(StatusMessage, {
|
|
3497
|
+
children: "Listening"
|
|
3498
|
+
});
|
|
3499
|
+
}
|
|
3500
|
+
if ([
|
|
3501
|
+
"recorderPaused",
|
|
3502
|
+
"idle",
|
|
3503
|
+
"playerPaused"
|
|
3504
|
+
].includes(audioThreadContext.status)) {
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(StatusMessage, {
|
|
3506
|
+
children: "Click to activate"
|
|
3507
|
+
});
|
|
3508
|
+
}
|
|
3509
|
+
if (audioThreadContext.status === "playing") {
|
|
3510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(StatusMessage, {
|
|
3511
|
+
children: "Click to interrupt"
|
|
3512
|
+
});
|
|
3513
|
+
}
|
|
3514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(StatusMessage, {
|
|
3515
|
+
children: "Thinking"
|
|
3516
|
+
});
|
|
3517
|
+
};
|
|
3460
3518
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3461
|
-
var
|
|
3462
|
-
|
|
3519
|
+
var import_themes46 = require("@radix-ui/themes");
|
|
3520
|
+
// src/components/threads/AudioThread/Form/MicIcon.tsx
|
|
3521
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3522
|
+
var MicIcon = function(props) {
|
|
3523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("svg", _object_spread_props(_object_spread({
|
|
3524
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3525
|
+
fill: "currentColor",
|
|
3526
|
+
stroke: "currentColor",
|
|
3527
|
+
strokeWidth: 0,
|
|
3528
|
+
viewBox: "0 0 384 512",
|
|
3529
|
+
height: "15",
|
|
3530
|
+
width: "15"
|
|
3531
|
+
}, props), {
|
|
3532
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("path", {
|
|
3533
|
+
stroke: "none",
|
|
3534
|
+
d: "M192 0c-53 0-96 43-96 96v160c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464h-48c-13.3 0-24 10.7-24 24s10.7 24 24 24h144c13.3 0 24-10.7 24-24s-10.7-24-24-24h-48v-33.6c85.8-11.7 152-85.3 152-174.4v-40c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128S64 326.7 64 256v-40z"
|
|
3535
|
+
})
|
|
3536
|
+
}));
|
|
3537
|
+
};
|
|
3463
3538
|
// src/components/threads/AudioThread/Form/ActionButton/index.tsx
|
|
3464
|
-
var
|
|
3539
|
+
var import_themes45 = require("@radix-ui/themes");
|
|
3465
3540
|
var import_react_icons9 = require("@radix-ui/react-icons");
|
|
3466
|
-
var
|
|
3541
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3467
3542
|
var ActionButton = function() {
|
|
3468
3543
|
var audioThreadContext = useAudioThreadContext();
|
|
3469
3544
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
3470
3545
|
if (audioThreadContext.status === "recording") {
|
|
3471
|
-
return /* @__PURE__ */ (0,
|
|
3546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_themes45.Flex, {
|
|
3472
3547
|
align: "center",
|
|
3473
3548
|
children: [
|
|
3474
|
-
/* @__PURE__ */ (0,
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.Flex, {
|
|
3475
3550
|
mr: "3",
|
|
3476
3551
|
ml: "-7",
|
|
3477
|
-
children: /* @__PURE__ */ (0,
|
|
3552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3478
3553
|
onClick: audioThreadContext.recorderProps.pause,
|
|
3479
3554
|
color: "gray",
|
|
3480
|
-
radius: "full",
|
|
3481
3555
|
variant: "soft",
|
|
3482
3556
|
size: "1",
|
|
3483
|
-
children: /* @__PURE__ */ (0,
|
|
3557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.PauseIcon, {})
|
|
3484
3558
|
})
|
|
3485
3559
|
}),
|
|
3486
|
-
/* @__PURE__ */ (0,
|
|
3560
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3487
3561
|
onClick: audioThreadContext.recorderProps.stop,
|
|
3488
3562
|
highContrast: true,
|
|
3489
|
-
radius: "full",
|
|
3490
3563
|
variant: "soft",
|
|
3491
3564
|
size: "4",
|
|
3492
|
-
|
|
3493
|
-
border: "2px solid var(--gray-8)"
|
|
3494
|
-
},
|
|
3495
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.ArrowUpIcon, {})
|
|
3565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.ArrowUpIcon, {})
|
|
3496
3566
|
})
|
|
3497
3567
|
]
|
|
3498
3568
|
});
|
|
3499
3569
|
}
|
|
3500
3570
|
if (audioThreadContext.status === "recorderPaused") {
|
|
3501
|
-
return /* @__PURE__ */ (0,
|
|
3571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3502
3572
|
onClick: audioThreadContext.recorderProps.resume,
|
|
3503
3573
|
color: "red",
|
|
3504
|
-
radius: "full",
|
|
3505
3574
|
size: "4",
|
|
3506
|
-
|
|
3507
|
-
border: "2px solid var(--gray-8)"
|
|
3508
|
-
},
|
|
3509
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3510
3576
|
});
|
|
3511
3577
|
}
|
|
3512
3578
|
if (audioThreadContext.status === "idle") {
|
|
3513
|
-
return /* @__PURE__ */ (0,
|
|
3579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3514
3580
|
onClick: function() {
|
|
3515
3581
|
return audioThreadContext.recorderProps.start();
|
|
3516
3582
|
},
|
|
3517
3583
|
size: "4",
|
|
3518
|
-
color: "red"
|
|
3519
|
-
radius: "full",
|
|
3520
|
-
style: {
|
|
3521
|
-
border: "2px solid var(--gray-8)"
|
|
3522
|
-
}
|
|
3584
|
+
color: "red"
|
|
3523
3585
|
});
|
|
3524
3586
|
}
|
|
3525
3587
|
if (audioThreadContext.status === "playing") {
|
|
3526
|
-
return /* @__PURE__ */ (0,
|
|
3588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3527
3589
|
onClick: function() {
|
|
3528
3590
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
3529
3591
|
audioThreadContext.messageAudioProps.stop();
|
|
@@ -3532,67 +3594,55 @@ var ActionButton = function() {
|
|
|
3532
3594
|
},
|
|
3533
3595
|
size: "4",
|
|
3534
3596
|
color: "gray",
|
|
3535
|
-
radius: "full",
|
|
3536
3597
|
variant: "soft",
|
|
3537
|
-
|
|
3538
|
-
border: "2px solid var(--gray-8)"
|
|
3539
|
-
},
|
|
3540
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.StopIcon, {})
|
|
3598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.StopIcon, {})
|
|
3541
3599
|
});
|
|
3542
3600
|
}
|
|
3543
3601
|
if (audioThreadContext.status === "playerPaused") {
|
|
3544
|
-
return /* @__PURE__ */ (0,
|
|
3602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3545
3603
|
onClick: function() {
|
|
3546
3604
|
return audioThreadContext.messageAudioProps.play();
|
|
3547
3605
|
},
|
|
3548
3606
|
size: "4",
|
|
3549
|
-
|
|
3550
|
-
style: {
|
|
3551
|
-
border: "2px solid var(--gray-8)"
|
|
3552
|
-
},
|
|
3553
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3554
3608
|
});
|
|
3555
3609
|
}
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3557
3611
|
size: "4",
|
|
3558
|
-
radius: "full",
|
|
3559
3612
|
variant: "soft",
|
|
3560
|
-
disabled: true
|
|
3561
|
-
style: {
|
|
3562
|
-
border: "2px solid var(--gray-8)"
|
|
3563
|
-
}
|
|
3613
|
+
disabled: true
|
|
3564
3614
|
});
|
|
3565
3615
|
};
|
|
3566
3616
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3567
|
-
var
|
|
3617
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3568
3618
|
var Form = function() {
|
|
3569
3619
|
var audioThreadContext = useAudioThreadContext();
|
|
3570
|
-
return /* @__PURE__ */ (0,
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_themes46.Flex, {
|
|
3571
3621
|
direction: "column",
|
|
3572
3622
|
align: "center",
|
|
3573
3623
|
children: [
|
|
3574
|
-
/* @__PURE__ */ (0,
|
|
3624
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_themes46.Flex, {
|
|
3575
3625
|
pb: "3",
|
|
3576
3626
|
align: "center",
|
|
3577
3627
|
children: [
|
|
3578
|
-
/* @__PURE__ */ (0,
|
|
3579
|
-
ml: "-
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_themes46.Flex, {
|
|
3629
|
+
ml: "-22.5px",
|
|
3580
3630
|
mr: "2",
|
|
3581
3631
|
align: "center",
|
|
3582
|
-
children: /* @__PURE__ */ (0,
|
|
3632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(MicIcon, {
|
|
3583
3633
|
style: {
|
|
3584
|
-
color: audioThreadContext.status === "recording" ? "var(--accent-
|
|
3634
|
+
color: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)"
|
|
3585
3635
|
}
|
|
3586
3636
|
})
|
|
3587
3637
|
}),
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3638
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_themes46.Flex, {
|
|
3589
3639
|
px: "2",
|
|
3590
3640
|
py: "1",
|
|
3591
3641
|
style: {
|
|
3592
3642
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-4)" : "var(--gray-4)",
|
|
3593
3643
|
borderRadius: "var(--radius-6)"
|
|
3594
3644
|
},
|
|
3595
|
-
children: /* @__PURE__ */ (0,
|
|
3645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(BarsVisualizer, {
|
|
3596
3646
|
visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser,
|
|
3597
3647
|
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3598
3648
|
height: "20px",
|
|
@@ -3601,17 +3651,18 @@ var Form = function() {
|
|
|
3601
3651
|
})
|
|
3602
3652
|
]
|
|
3603
3653
|
}),
|
|
3604
|
-
/* @__PURE__ */ (0,
|
|
3654
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ActionButton, {})
|
|
3605
3655
|
]
|
|
3606
3656
|
});
|
|
3607
3657
|
};
|
|
3608
3658
|
// src/components/threads/AudioThread/index.tsx
|
|
3609
|
-
var
|
|
3659
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3610
3660
|
var AudioThread = function(props) {
|
|
3611
|
-
return /* @__PURE__ */ (0,
|
|
3661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Root8, _object_spread_props(_object_spread({}, props), {
|
|
3612
3662
|
children: [
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Visualization, {}),
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Status, {}),
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Form, {})
|
|
3615
3666
|
]
|
|
3616
3667
|
}));
|
|
3617
3668
|
};
|
|
@@ -3619,15 +3670,15 @@ AudioThread.Root = Root8;
|
|
|
3619
3670
|
AudioThread.Visualization = Visualization;
|
|
3620
3671
|
AudioThread.Form = Form;
|
|
3621
3672
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
3622
|
-
var
|
|
3673
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3623
3674
|
var AudioThreadDialog = function() {
|
|
3624
|
-
return /* @__PURE__ */ (0,
|
|
3675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Root6, {
|
|
3625
3676
|
children: [
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
3627
|
-
children: /* @__PURE__ */ (0,
|
|
3677
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Content4.Root, {
|
|
3678
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(AudioThread, {})
|
|
3628
3679
|
}),
|
|
3629
|
-
/* @__PURE__ */ (0,
|
|
3630
|
-
children: /* @__PURE__ */ (0,
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Trigger, {
|
|
3681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button2, {})
|
|
3631
3682
|
})
|
|
3632
3683
|
]
|
|
3633
3684
|
});
|
|
@@ -3637,20 +3688,20 @@ AudioThreadDialog.Trigger = Trigger;
|
|
|
3637
3688
|
AudioThreadDialog.Button = Button2;
|
|
3638
3689
|
AudioThreadDialog.Content = Content4;
|
|
3639
3690
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3640
|
-
var
|
|
3691
|
+
var import_react46 = require("react");
|
|
3641
3692
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
3642
|
-
var
|
|
3693
|
+
var import_react45 = require("react");
|
|
3643
3694
|
var import_radash13 = require("radash");
|
|
3644
3695
|
var import_react_children_utilities = require("react-children-utilities");
|
|
3645
|
-
var
|
|
3696
|
+
var import_themes48 = require("@radix-ui/themes");
|
|
3646
3697
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
3647
|
-
var
|
|
3648
|
-
var
|
|
3649
|
-
var
|
|
3698
|
+
var import_react_icons10 = require("@radix-ui/react-icons");
|
|
3699
|
+
var import_themes47 = require("@radix-ui/themes");
|
|
3700
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3650
3701
|
var Item = function(param) {
|
|
3651
3702
|
var suggestion = param.suggestion, isDisabled = param.isDisabled;
|
|
3652
3703
|
var _useCreateMessage = useCreateMessage(), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
|
|
3653
|
-
return /* @__PURE__ */ (0,
|
|
3704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Content5, {
|
|
3654
3705
|
onClick: function() {
|
|
3655
3706
|
createMessage({
|
|
3656
3707
|
// @ts-ignore-next-line
|
|
@@ -3664,7 +3715,7 @@ var Item = function(param) {
|
|
|
3664
3715
|
};
|
|
3665
3716
|
var Content5 = function(param) {
|
|
3666
3717
|
var onClick = param.onClick, isDisabled = param.isDisabled, isPending = param.isPending, children = param.children;
|
|
3667
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_themes47.Button, {
|
|
3668
3719
|
variant: "soft",
|
|
3669
3720
|
onClick: onClick,
|
|
3670
3721
|
disabled: isDisabled,
|
|
@@ -3674,14 +3725,14 @@ var Content5 = function(param) {
|
|
|
3674
3725
|
flexShrink: 1
|
|
3675
3726
|
},
|
|
3676
3727
|
children: [
|
|
3677
|
-
/* @__PURE__ */ (0,
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_themes47.Text, {
|
|
3678
3729
|
size: "1",
|
|
3679
3730
|
weight: "regular",
|
|
3680
3731
|
children: children
|
|
3681
3732
|
}),
|
|
3682
|
-
/* @__PURE__ */ (0,
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_themes47.Spinner, {
|
|
3683
3734
|
loading: isPending,
|
|
3684
|
-
children: /* @__PURE__ */ (0,
|
|
3735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react_icons10.ArrowUpIcon, {
|
|
3685
3736
|
style: {
|
|
3686
3737
|
flexShrink: 0
|
|
3687
3738
|
}
|
|
@@ -3692,11 +3743,11 @@ var Content5 = function(param) {
|
|
|
3692
3743
|
};
|
|
3693
3744
|
Item.Content = Content5;
|
|
3694
3745
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
3695
|
-
var
|
|
3746
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3696
3747
|
var Content6 = function(param) {
|
|
3697
3748
|
var children = param.children;
|
|
3698
3749
|
var isMutatingMessage = useIsMutatingMessage();
|
|
3699
|
-
var suggestions = (0,
|
|
3750
|
+
var suggestions = (0, import_react45.useMemo)(function() {
|
|
3700
3751
|
return (0, import_react_children_utilities.onlyText)(children).split(/\r?\n/).filter(function(c) {
|
|
3701
3752
|
return !(0, import_radash13.isEmpty)(c);
|
|
3702
3753
|
}).map(function(c) {
|
|
@@ -3706,12 +3757,12 @@ var Content6 = function(param) {
|
|
|
3706
3757
|
children
|
|
3707
3758
|
]);
|
|
3708
3759
|
if ((0, import_radash13.isEmpty)(suggestions)) return null;
|
|
3709
|
-
return /* @__PURE__ */ (0,
|
|
3760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_themes48.Flex, {
|
|
3710
3761
|
gap: "2",
|
|
3711
3762
|
py: "2",
|
|
3712
3763
|
wrap: "wrap",
|
|
3713
3764
|
children: suggestions.map(function(suggestion) {
|
|
3714
|
-
return /* @__PURE__ */ (0,
|
|
3765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Item, {
|
|
3715
3766
|
suggestion: suggestion,
|
|
3716
3767
|
isDisabled: isMutatingMessage
|
|
3717
3768
|
}, suggestion);
|
|
@@ -3719,11 +3770,11 @@ var Content6 = function(param) {
|
|
|
3719
3770
|
});
|
|
3720
3771
|
};
|
|
3721
3772
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3722
|
-
var
|
|
3773
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3723
3774
|
var Suggestions = function(param) {
|
|
3724
3775
|
var children = param.children;
|
|
3725
3776
|
var latestMessageProps = useLatestMessage();
|
|
3726
|
-
var isDisabled = (0,
|
|
3777
|
+
var isDisabled = (0, import_react46.useMemo)(function() {
|
|
3727
3778
|
var // @ts-ignore-next-line
|
|
3728
3779
|
_latestMessageProps_latestMessage_metadata, _latestMessageProps_latestMessage;
|
|
3729
3780
|
return (_latestMessageProps_latestMessage = latestMessageProps.latestMessage) === null || _latestMessageProps_latestMessage === void 0 ? void 0 : (_latestMessageProps_latestMessage_metadata = _latestMessageProps_latestMessage.metadata) === null || _latestMessageProps_latestMessage_metadata === void 0 ? void 0 : _latestMessageProps_latestMessage_metadata.isBlocking;
|
|
@@ -3732,26 +3783,26 @@ var Suggestions = function(param) {
|
|
|
3732
3783
|
]);
|
|
3733
3784
|
if (latestMessageProps.isLoading) return null;
|
|
3734
3785
|
if (isDisabled) return null;
|
|
3735
|
-
return /* @__PURE__ */ (0,
|
|
3786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Content6, {
|
|
3736
3787
|
children: children
|
|
3737
3788
|
});
|
|
3738
3789
|
};
|
|
3739
3790
|
Suggestions.Item = Item;
|
|
3740
3791
|
// src/components/markdown/MarkdownProvider/index.tsx
|
|
3741
|
-
var
|
|
3742
|
-
var
|
|
3792
|
+
var import_react47 = require("react");
|
|
3793
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3743
3794
|
var MarkdownProvider = function(_param) {
|
|
3744
3795
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3745
3796
|
"children"
|
|
3746
3797
|
]);
|
|
3747
3798
|
var prevMarkdownContext = useMarkdownContext();
|
|
3748
|
-
var value = (0,
|
|
3799
|
+
var value = (0, import_react47.useMemo)(function() {
|
|
3749
3800
|
return merge(prevMarkdownContext, rest);
|
|
3750
3801
|
}, [
|
|
3751
3802
|
rest,
|
|
3752
3803
|
prevMarkdownContext
|
|
3753
3804
|
]);
|
|
3754
|
-
return /* @__PURE__ */ (0,
|
|
3805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(MarkdownContext.Provider, {
|
|
3755
3806
|
value: value,
|
|
3756
3807
|
children: children
|
|
3757
3808
|
});
|