@ -61,6 +61,8 @@ export const ZodFieldLayout = ({
|
||||
const innerSchema = getZodInnerSchema(schema)
|
||||
const layout = innerSchema._def.layout
|
||||
|
||||
if (layout?.isHidden) return null
|
||||
|
||||
switch (innerSchema._def.typeName) {
|
||||
case 'ZodObject':
|
||||
return (
|
||||
|
@ -9,6 +9,7 @@ import {
|
||||
Text,
|
||||
} from '@chakra-ui/react'
|
||||
import { z } from '@typebot.io/forge/zod'
|
||||
import React from 'react'
|
||||
import { ZodLayoutMetadata } from '@typebot.io/forge/zod'
|
||||
import { ReactNode } from 'react'
|
||||
import { ZodTypeAny } from 'zod'
|
||||
@ -32,7 +33,9 @@ export const ZodObjectLayout = ({
|
||||
blockDef?: ForgedBlockDefinition
|
||||
blockOptions?: ForgedBlock['options']
|
||||
onDataChange: (value: any) => void
|
||||
}) => {
|
||||
}): ReactNode[] => {
|
||||
const layout = getZodInnerSchema(schema)._def.layout
|
||||
if (layout?.isHidden) return []
|
||||
return Object.keys(schema.shape).reduce<{
|
||||
nodes: ReactNode[]
|
||||
accordionsCreated: string[]
|
||||
@ -43,6 +46,8 @@ export const ZodObjectLayout = ({
|
||||
const layout = keySchema._def.layout as
|
||||
| ZodLayoutMetadata<ZodTypeAny>
|
||||
| undefined
|
||||
|
||||
if (layout?.isHidden) return nodes
|
||||
if (
|
||||
layout &&
|
||||
layout.accordion &&
|
||||
|
@ -18792,7 +18792,8 @@
|
||||
"qr-code",
|
||||
"dify-ai",
|
||||
"mistral",
|
||||
"elevenlabs"
|
||||
"elevenlabs",
|
||||
"together-ai"
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
|
@ -9413,7 +9413,8 @@
|
||||
"qr-code",
|
||||
"dify-ai",
|
||||
"mistral",
|
||||
"elevenlabs"
|
||||
"elevenlabs",
|
||||
"together-ai"
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
|
Reference in New Issue
Block a user