2
0

🚑 Add back runtimeOptions and fix popup width option

This commit is contained in:
Baptiste Arnaud
2023-12-22 10:24:33 +01:00
parent 1e5fa5a575
commit 867e68c4d9
8 changed files with 300 additions and 196 deletions

View File

@@ -1335,6 +1335,8 @@
}
},
"input": {
"allOf": [
{
"anyOf": [
{
"oneOf": [
@@ -1412,6 +1414,35 @@
}
]
},
{
"type": "object",
"properties": {
"prefilledValue": {
"type": "string"
},
"runtimeOptions": {
"type": "object",
"properties": {
"paymentIntentSecret": {
"type": "string"
},
"amountLabel": {
"type": "string"
},
"publicKey": {
"type": "string"
}
},
"required": [
"paymentIntentSecret",
"amountLabel",
"publicKey"
]
}
}
}
]
},
"clientSideActions": {
"type": "array",
"items": {
@@ -1711,6 +1742,8 @@
}
},
"input": {
"allOf": [
{
"anyOf": [
{
"oneOf": [
@@ -1788,6 +1821,35 @@
}
]
},
{
"type": "object",
"properties": {
"prefilledValue": {
"type": "string"
},
"runtimeOptions": {
"type": "object",
"properties": {
"paymentIntentSecret": {
"type": "string"
},
"amountLabel": {
"type": "string"
},
"publicKey": {
"type": "string"
}
},
"required": [
"paymentIntentSecret",
"amountLabel",
"publicKey"
]
}
}
}
]
},
"clientSideActions": {
"type": "array",
"items": {
@@ -2175,6 +2237,8 @@
}
},
"input": {
"allOf": [
{
"anyOf": [
{
"oneOf": [
@@ -2252,6 +2316,35 @@
}
]
},
{
"type": "object",
"properties": {
"prefilledValue": {
"type": "string"
},
"runtimeOptions": {
"type": "object",
"properties": {
"paymentIntentSecret": {
"type": "string"
},
"amountLabel": {
"type": "string"
},
"publicKey": {
"type": "string"
}
},
"required": [
"paymentIntentSecret",
"amountLabel",
"publicKey"
]
}
}
}
]
},
"clientSideActions": {
"type": "array",
"items": {

View File

@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.2.30",
"version": "0.2.31",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",

View File

@@ -126,12 +126,13 @@ export const Popup = (props: PopupProps) => {
<div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0">
<div
class={
'relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 sm:w-full sm:max-w-lg' +
'relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg' +
(props.theme?.backgroundColor ? ' shadow-xl' : '')
}
style={{
'background-color':
props.theme?.backgroundColor ?? 'transparent',
'max-width': props.theme?.width ?? '512px',
}}
on:pointerdown={stopPropagation}
>

View File

@@ -105,6 +105,7 @@ export async function startChatQuery({
isStreamEnabled: true,
prefilledVariables,
resultId,
isOnlyRegistering: false,
} satisfies Omit<StartChatInput, 'publicId'>,
timeout: false,
}

View File

@@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.2.30",
"version": "0.2.31",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.30",
"version": "0.2.31",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -11,6 +11,9 @@ export const Default = () => {
typebot={leadGenerationTypebot}
apiHost="http://localhost:3001"
autoShowDelay={3000}
theme={{
width: '800px',
}}
isPreview
/>
</>

View File

@@ -290,6 +290,12 @@ const chatResponseBaseSchema = z.object({
pictureChoiceBlockSchemas.v5,
]),
])
.and(
z.object({
prefilledValue: z.string().optional(),
runtimeOptions: runtimeOptionsSchema.optional(),
})
)
.optional(),
clientSideActions: z
.array(clientSideActionSchema)