@superinterface/react 2.12.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 +171 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +166 -102
- 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,96 +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
|
|
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
|
+
};
|
|
3462
3538
|
// src/components/threads/AudioThread/Form/ActionButton/index.tsx
|
|
3463
|
-
var
|
|
3539
|
+
var import_themes45 = require("@radix-ui/themes");
|
|
3464
3540
|
var import_react_icons9 = require("@radix-ui/react-icons");
|
|
3465
|
-
var
|
|
3541
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3466
3542
|
var ActionButton = function() {
|
|
3467
3543
|
var audioThreadContext = useAudioThreadContext();
|
|
3468
3544
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
3469
3545
|
if (audioThreadContext.status === "recording") {
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_themes45.Flex, {
|
|
3471
3547
|
align: "center",
|
|
3472
3548
|
children: [
|
|
3473
|
-
/* @__PURE__ */ (0,
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.Flex, {
|
|
3474
3550
|
mr: "3",
|
|
3475
3551
|
ml: "-7",
|
|
3476
|
-
children: /* @__PURE__ */ (0,
|
|
3552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3477
3553
|
onClick: audioThreadContext.recorderProps.pause,
|
|
3478
3554
|
color: "gray",
|
|
3479
|
-
radius: "full",
|
|
3480
3555
|
variant: "soft",
|
|
3481
3556
|
size: "1",
|
|
3482
|
-
children: /* @__PURE__ */ (0,
|
|
3557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.PauseIcon, {})
|
|
3483
3558
|
})
|
|
3484
3559
|
}),
|
|
3485
|
-
/* @__PURE__ */ (0,
|
|
3560
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3486
3561
|
onClick: audioThreadContext.recorderProps.stop,
|
|
3487
3562
|
highContrast: true,
|
|
3488
|
-
radius: "full",
|
|
3489
3563
|
variant: "soft",
|
|
3490
3564
|
size: "4",
|
|
3491
|
-
|
|
3492
|
-
border: "2px solid var(--gray-8)"
|
|
3493
|
-
},
|
|
3494
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.ArrowUpIcon, {})
|
|
3565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.ArrowUpIcon, {})
|
|
3495
3566
|
})
|
|
3496
3567
|
]
|
|
3497
3568
|
});
|
|
3498
3569
|
}
|
|
3499
3570
|
if (audioThreadContext.status === "recorderPaused") {
|
|
3500
|
-
return /* @__PURE__ */ (0,
|
|
3571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3501
3572
|
onClick: audioThreadContext.recorderProps.resume,
|
|
3502
3573
|
color: "red",
|
|
3503
|
-
radius: "full",
|
|
3504
3574
|
size: "4",
|
|
3505
|
-
|
|
3506
|
-
border: "2px solid var(--gray-8)"
|
|
3507
|
-
},
|
|
3508
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3509
3576
|
});
|
|
3510
3577
|
}
|
|
3511
3578
|
if (audioThreadContext.status === "idle") {
|
|
3512
|
-
return /* @__PURE__ */ (0,
|
|
3579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3513
3580
|
onClick: function() {
|
|
3514
3581
|
return audioThreadContext.recorderProps.start();
|
|
3515
3582
|
},
|
|
3516
3583
|
size: "4",
|
|
3517
|
-
color: "red"
|
|
3518
|
-
radius: "full",
|
|
3519
|
-
style: {
|
|
3520
|
-
border: "2px solid var(--gray-8)"
|
|
3521
|
-
}
|
|
3584
|
+
color: "red"
|
|
3522
3585
|
});
|
|
3523
3586
|
}
|
|
3524
3587
|
if (audioThreadContext.status === "playing") {
|
|
3525
|
-
return /* @__PURE__ */ (0,
|
|
3588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3526
3589
|
onClick: function() {
|
|
3527
3590
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
3528
3591
|
audioThreadContext.messageAudioProps.stop();
|
|
@@ -3531,74 +3594,75 @@ var ActionButton = function() {
|
|
|
3531
3594
|
},
|
|
3532
3595
|
size: "4",
|
|
3533
3596
|
color: "gray",
|
|
3534
|
-
radius: "full",
|
|
3535
3597
|
variant: "soft",
|
|
3536
|
-
|
|
3537
|
-
border: "2px solid var(--gray-8)"
|
|
3538
|
-
},
|
|
3539
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.StopIcon, {})
|
|
3598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.StopIcon, {})
|
|
3540
3599
|
});
|
|
3541
3600
|
}
|
|
3542
3601
|
if (audioThreadContext.status === "playerPaused") {
|
|
3543
|
-
return /* @__PURE__ */ (0,
|
|
3602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3544
3603
|
onClick: function() {
|
|
3545
3604
|
return audioThreadContext.messageAudioProps.play();
|
|
3546
3605
|
},
|
|
3547
3606
|
size: "4",
|
|
3548
|
-
|
|
3549
|
-
style: {
|
|
3550
|
-
border: "2px solid var(--gray-8)"
|
|
3551
|
-
},
|
|
3552
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react_icons9.ResumeIcon, {})
|
|
3553
3608
|
});
|
|
3554
3609
|
}
|
|
3555
|
-
return /* @__PURE__ */ (0,
|
|
3610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_themes45.IconButton, {
|
|
3556
3611
|
size: "4",
|
|
3557
|
-
radius: "full",
|
|
3558
3612
|
variant: "soft",
|
|
3559
|
-
disabled: true
|
|
3560
|
-
style: {
|
|
3561
|
-
border: "2px solid var(--gray-8)"
|
|
3562
|
-
}
|
|
3613
|
+
disabled: true
|
|
3563
3614
|
});
|
|
3564
3615
|
};
|
|
3565
3616
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
3566
|
-
var
|
|
3617
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3567
3618
|
var Form = function() {
|
|
3568
3619
|
var audioThreadContext = useAudioThreadContext();
|
|
3569
|
-
return /* @__PURE__ */ (0,
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_themes46.Flex, {
|
|
3570
3621
|
direction: "column",
|
|
3571
3622
|
align: "center",
|
|
3572
3623
|
children: [
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
3624
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_themes46.Flex, {
|
|
3574
3625
|
pb: "3",
|
|
3575
3626
|
align: "center",
|
|
3576
|
-
children:
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3627
|
+
children: [
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_themes46.Flex, {
|
|
3629
|
+
ml: "-22.5px",
|
|
3630
|
+
mr: "2",
|
|
3631
|
+
align: "center",
|
|
3632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(MicIcon, {
|
|
3633
|
+
style: {
|
|
3634
|
+
color: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)"
|
|
3635
|
+
}
|
|
3636
|
+
})
|
|
3637
|
+
}),
|
|
3638
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_themes46.Flex, {
|
|
3639
|
+
px: "2",
|
|
3640
|
+
py: "1",
|
|
3641
|
+
style: {
|
|
3642
|
+
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-4)" : "var(--gray-4)",
|
|
3643
|
+
borderRadius: "var(--radius-6)"
|
|
3644
|
+
},
|
|
3645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(BarsVisualizer, {
|
|
3646
|
+
visualizationAnalyser: audioThreadContext.recorderProps.visualizationAnalyser,
|
|
3647
|
+
backgroundColor: audioThreadContext.status === "recording" ? "var(--accent-11)" : "var(--gray-11)",
|
|
3648
|
+
height: "20px",
|
|
3649
|
+
barWidth: "12px"
|
|
3650
|
+
})
|
|
3588
3651
|
})
|
|
3589
|
-
|
|
3652
|
+
]
|
|
3590
3653
|
}),
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3654
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ActionButton, {})
|
|
3592
3655
|
]
|
|
3593
3656
|
});
|
|
3594
3657
|
};
|
|
3595
3658
|
// src/components/threads/AudioThread/index.tsx
|
|
3596
|
-
var
|
|
3659
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3597
3660
|
var AudioThread = function(props) {
|
|
3598
|
-
return /* @__PURE__ */ (0,
|
|
3661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Root8, _object_spread_props(_object_spread({}, props), {
|
|
3599
3662
|
children: [
|
|
3600
|
-
/* @__PURE__ */ (0,
|
|
3601
|
-
/* @__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, {})
|
|
3602
3666
|
]
|
|
3603
3667
|
}));
|
|
3604
3668
|
};
|
|
@@ -3606,15 +3670,15 @@ AudioThread.Root = Root8;
|
|
|
3606
3670
|
AudioThread.Visualization = Visualization;
|
|
3607
3671
|
AudioThread.Form = Form;
|
|
3608
3672
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
3609
|
-
var
|
|
3673
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3610
3674
|
var AudioThreadDialog = function() {
|
|
3611
|
-
return /* @__PURE__ */ (0,
|
|
3675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Root6, {
|
|
3612
3676
|
children: [
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3614
|
-
children: /* @__PURE__ */ (0,
|
|
3677
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Content4.Root, {
|
|
3678
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(AudioThread, {})
|
|
3615
3679
|
}),
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
3617
|
-
children: /* @__PURE__ */ (0,
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Trigger, {
|
|
3681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button2, {})
|
|
3618
3682
|
})
|
|
3619
3683
|
]
|
|
3620
3684
|
});
|
|
@@ -3624,20 +3688,20 @@ AudioThreadDialog.Trigger = Trigger;
|
|
|
3624
3688
|
AudioThreadDialog.Button = Button2;
|
|
3625
3689
|
AudioThreadDialog.Content = Content4;
|
|
3626
3690
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3627
|
-
var
|
|
3691
|
+
var import_react46 = require("react");
|
|
3628
3692
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
3629
|
-
var
|
|
3693
|
+
var import_react45 = require("react");
|
|
3630
3694
|
var import_radash13 = require("radash");
|
|
3631
3695
|
var import_react_children_utilities = require("react-children-utilities");
|
|
3632
|
-
var
|
|
3696
|
+
var import_themes48 = require("@radix-ui/themes");
|
|
3633
3697
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
3634
3698
|
var import_react_icons10 = require("@radix-ui/react-icons");
|
|
3635
|
-
var
|
|
3636
|
-
var
|
|
3699
|
+
var import_themes47 = require("@radix-ui/themes");
|
|
3700
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3637
3701
|
var Item = function(param) {
|
|
3638
3702
|
var suggestion = param.suggestion, isDisabled = param.isDisabled;
|
|
3639
3703
|
var _useCreateMessage = useCreateMessage(), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
|
|
3640
|
-
return /* @__PURE__ */ (0,
|
|
3704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Content5, {
|
|
3641
3705
|
onClick: function() {
|
|
3642
3706
|
createMessage({
|
|
3643
3707
|
// @ts-ignore-next-line
|
|
@@ -3651,7 +3715,7 @@ var Item = function(param) {
|
|
|
3651
3715
|
};
|
|
3652
3716
|
var Content5 = function(param) {
|
|
3653
3717
|
var onClick = param.onClick, isDisabled = param.isDisabled, isPending = param.isPending, children = param.children;
|
|
3654
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_themes47.Button, {
|
|
3655
3719
|
variant: "soft",
|
|
3656
3720
|
onClick: onClick,
|
|
3657
3721
|
disabled: isDisabled,
|
|
@@ -3661,14 +3725,14 @@ var Content5 = function(param) {
|
|
|
3661
3725
|
flexShrink: 1
|
|
3662
3726
|
},
|
|
3663
3727
|
children: [
|
|
3664
|
-
/* @__PURE__ */ (0,
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_themes47.Text, {
|
|
3665
3729
|
size: "1",
|
|
3666
3730
|
weight: "regular",
|
|
3667
3731
|
children: children
|
|
3668
3732
|
}),
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_themes47.Spinner, {
|
|
3670
3734
|
loading: isPending,
|
|
3671
|
-
children: /* @__PURE__ */ (0,
|
|
3735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react_icons10.ArrowUpIcon, {
|
|
3672
3736
|
style: {
|
|
3673
3737
|
flexShrink: 0
|
|
3674
3738
|
}
|
|
@@ -3679,11 +3743,11 @@ var Content5 = function(param) {
|
|
|
3679
3743
|
};
|
|
3680
3744
|
Item.Content = Content5;
|
|
3681
3745
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
3682
|
-
var
|
|
3746
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3683
3747
|
var Content6 = function(param) {
|
|
3684
3748
|
var children = param.children;
|
|
3685
3749
|
var isMutatingMessage = useIsMutatingMessage();
|
|
3686
|
-
var suggestions = (0,
|
|
3750
|
+
var suggestions = (0, import_react45.useMemo)(function() {
|
|
3687
3751
|
return (0, import_react_children_utilities.onlyText)(children).split(/\r?\n/).filter(function(c) {
|
|
3688
3752
|
return !(0, import_radash13.isEmpty)(c);
|
|
3689
3753
|
}).map(function(c) {
|
|
@@ -3693,12 +3757,12 @@ var Content6 = function(param) {
|
|
|
3693
3757
|
children
|
|
3694
3758
|
]);
|
|
3695
3759
|
if ((0, import_radash13.isEmpty)(suggestions)) return null;
|
|
3696
|
-
return /* @__PURE__ */ (0,
|
|
3760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_themes48.Flex, {
|
|
3697
3761
|
gap: "2",
|
|
3698
3762
|
py: "2",
|
|
3699
3763
|
wrap: "wrap",
|
|
3700
3764
|
children: suggestions.map(function(suggestion) {
|
|
3701
|
-
return /* @__PURE__ */ (0,
|
|
3765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Item, {
|
|
3702
3766
|
suggestion: suggestion,
|
|
3703
3767
|
isDisabled: isMutatingMessage
|
|
3704
3768
|
}, suggestion);
|
|
@@ -3706,11 +3770,11 @@ var Content6 = function(param) {
|
|
|
3706
3770
|
});
|
|
3707
3771
|
};
|
|
3708
3772
|
// src/components/suggestions/Suggestions/index.tsx
|
|
3709
|
-
var
|
|
3773
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3710
3774
|
var Suggestions = function(param) {
|
|
3711
3775
|
var children = param.children;
|
|
3712
3776
|
var latestMessageProps = useLatestMessage();
|
|
3713
|
-
var isDisabled = (0,
|
|
3777
|
+
var isDisabled = (0, import_react46.useMemo)(function() {
|
|
3714
3778
|
var // @ts-ignore-next-line
|
|
3715
3779
|
_latestMessageProps_latestMessage_metadata, _latestMessageProps_latestMessage;
|
|
3716
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;
|
|
@@ -3719,26 +3783,26 @@ var Suggestions = function(param) {
|
|
|
3719
3783
|
]);
|
|
3720
3784
|
if (latestMessageProps.isLoading) return null;
|
|
3721
3785
|
if (isDisabled) return null;
|
|
3722
|
-
return /* @__PURE__ */ (0,
|
|
3786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Content6, {
|
|
3723
3787
|
children: children
|
|
3724
3788
|
});
|
|
3725
3789
|
};
|
|
3726
3790
|
Suggestions.Item = Item;
|
|
3727
3791
|
// src/components/markdown/MarkdownProvider/index.tsx
|
|
3728
|
-
var
|
|
3729
|
-
var
|
|
3792
|
+
var import_react47 = require("react");
|
|
3793
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3730
3794
|
var MarkdownProvider = function(_param) {
|
|
3731
3795
|
var children = _param.children, rest = _object_without_properties(_param, [
|
|
3732
3796
|
"children"
|
|
3733
3797
|
]);
|
|
3734
3798
|
var prevMarkdownContext = useMarkdownContext();
|
|
3735
|
-
var value = (0,
|
|
3799
|
+
var value = (0, import_react47.useMemo)(function() {
|
|
3736
3800
|
return merge(prevMarkdownContext, rest);
|
|
3737
3801
|
}, [
|
|
3738
3802
|
rest,
|
|
3739
3803
|
prevMarkdownContext
|
|
3740
3804
|
]);
|
|
3741
|
-
return /* @__PURE__ */ (0,
|
|
3805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(MarkdownContext.Provider, {
|
|
3742
3806
|
value: value,
|
|
3743
3807
|
children: children
|
|
3744
3808
|
});
|