2
0

📝 Add Contribute docs

This commit is contained in:
Baptiste Arnaud
2024-01-03 16:29:41 +01:00
parent b3957295bd
commit 65f4fb0d7a
66 changed files with 1453 additions and 519 deletions

View File

@ -95,6 +95,7 @@ export const option = {
object: <T extends z.ZodRawShape>(schema: T) => z.object(schema),
literal: <T extends string>(value: T) => z.literal(value),
string: z.string().optional(),
boolean: z.boolean().optional(),
enum: <T extends string>(values: readonly [T, ...T[]]) =>
z.enum(values).optional(),
number: z.number().or(variableStringSchema).optional(),
@ -123,7 +124,7 @@ export const option = {
defaultValue: items[0],
}),
variableId: z.string().optional().layout({
input: 'variableDropdown',
inputType: 'variableDropdown',
}),
})
)

View File

@ -117,7 +117,6 @@ export type BlockDefinition<
auth?: Auth
options?: Options | undefined
fetchers?: FetcherDefinition<Auth, Options>[]
isDisabledInPreview?: boolean
actions: ActionDefinition<Auth, Options>[]
}

View File

@ -8,7 +8,7 @@ export interface ZodLayoutMetadata<
> {
accordion?: string
label?: string
input?: 'variableDropdown' | 'textarea' | 'password'
inputType?: 'variableDropdown' | 'textarea' | 'password'
defaultValue?: T extends ZodDate ? string : TInferred
placeholder?: string
helperText?: string
@ -18,7 +18,6 @@ export interface ZodLayoutMetadata<
fetcher?: T extends OptionableZodType<ZodString> ? string : never
itemLabel?: T extends OptionableZodType<ZodArray<any>> ? string : never
isOrdered?: T extends OptionableZodType<ZodArray<any>> ? boolean : never
isHidden?: boolean
moreInfoTooltip?: string
}