pass correct prop
This commit is contained in:
parent
c6493f2f99
commit
0709f68f47
|
@ -42,8 +42,11 @@
|
||||||
|
|
||||||
$: accountPortalAccess = $auth?.user?.accountPortalAccess
|
$: accountPortalAccess = $auth?.user?.accountPortalAccess
|
||||||
$: accountPortal = $admin.accountPortalUrl
|
$: accountPortal = $admin.accountPortalUrl
|
||||||
$: aiEnabled = !!$auth?.user?.llm
|
$: aiEnabled = false
|
||||||
$: expanded = expandedOnly ? true : expanded
|
$: expanded = expandedOnly ? true : expanded
|
||||||
|
$: if (expandedOnly) {
|
||||||
|
containerWidth = calculateExpandedWidth()
|
||||||
|
}
|
||||||
|
|
||||||
async function generateJs(prompt: string) {
|
async function generateJs(prompt: string) {
|
||||||
if (!prompt.trim()) return
|
if (!prompt.trim()) return
|
||||||
|
@ -90,14 +93,17 @@
|
||||||
animateBorder = false
|
animateBorder = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calculateExpandedWidth() {
|
||||||
|
return parentWidth
|
||||||
|
? `${Math.min(Math.max(parentWidth * 0.8, 300), 600)}px`
|
||||||
|
: "300px"
|
||||||
|
}
|
||||||
|
|
||||||
function toggleExpand() {
|
function toggleExpand() {
|
||||||
if (!expanded) {
|
if (!expanded) {
|
||||||
expanded = true
|
expanded = true
|
||||||
animateBorder = true
|
animateBorder = true
|
||||||
// Calculate width based on size of parent
|
containerWidth = calculateExpandedWidth()
|
||||||
containerWidth = parentWidth
|
|
||||||
? `${Math.min(Math.max(parentWidth * 0.8, 300), 600)}px`
|
|
||||||
: "300px"
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
promptInput?.focus()
|
promptInput?.focus()
|
||||||
}, 250)
|
}, 250)
|
||||||
|
|
|
@ -469,6 +469,7 @@
|
||||||
|
|
||||||
{#if aiGenEnabled}
|
{#if aiGenEnabled}
|
||||||
<AIGen
|
<AIGen
|
||||||
|
expandedOnly={true}
|
||||||
{bindings}
|
{bindings}
|
||||||
{value}
|
{value}
|
||||||
parentWidth={editorWidth}
|
parentWidth={editorWidth}
|
||||||
|
|
Loading…
Reference in New Issue