-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a04030
commit d54ebc0
Showing
33 changed files
with
465 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
import { ChatIcon, FlagIcon, TextIcon } from 'assets/icons' | ||
import { StepType } from 'models' | ||
import { ChatIcon, FlagIcon, NumberIcon, TextIcon } from 'assets/icons' | ||
import { BubbleStepType, InputStepType, StepType } from 'models' | ||
import React from 'react' | ||
|
||
type StepIconProps = { type: StepType } | ||
|
||
export const StepIcon = ({ type }: StepIconProps) => { | ||
switch (type) { | ||
case StepType.TEXT: { | ||
case BubbleStepType.TEXT: { | ||
return <ChatIcon /> | ||
} | ||
case StepType.TEXT: { | ||
case InputStepType.TEXT: { | ||
return <TextIcon /> | ||
} | ||
case StepType.START: { | ||
case InputStepType.NUMBER: { | ||
return <NumberIcon /> | ||
} | ||
case 'start': { | ||
return <FlagIcon /> | ||
} | ||
default: { | ||
return <TextIcon /> | ||
return <></> | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
apps/builder/components/board/StepTypesList/StepTypeLabel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Text } from '@chakra-ui/react' | ||
import { BubbleStepType, InputStepType, StepType } from 'models' | ||
import React from 'react' | ||
|
||
type Props = { type: StepType } | ||
|
||
export const StepTypeLabel = ({ type }: Props) => { | ||
switch (type) { | ||
case BubbleStepType.TEXT: | ||
case InputStepType.TEXT: { | ||
return <Text>Text</Text> | ||
} | ||
case InputStepType.NUMBER: { | ||
return <Text>Number</Text> | ||
} | ||
default: { | ||
return <></> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...ponents/board/graph/BlockNode/StepNode/SettingsPopoverContent/NumberInputSettingsBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { FormLabel, HStack, Stack } from '@chakra-ui/react' | ||
import { SmartNumberInput } from 'components/settings/SmartNumberInput' | ||
import { DebouncedInput } from 'components/shared/DebouncedInput' | ||
import { NumberInputOptions } from 'models' | ||
import React from 'react' | ||
import { removeUndefinedFields } from 'services/utils' | ||
|
||
type NumberInputSettingsBodyProps = { | ||
options?: NumberInputOptions | ||
onOptionsChange: (options: NumberInputOptions) => void | ||
} | ||
|
||
export const NumberInputSettingsBody = ({ | ||
options, | ||
onOptionsChange, | ||
}: NumberInputSettingsBodyProps) => { | ||
const handlePlaceholderChange = (placeholder: string) => | ||
onOptionsChange({ ...options, labels: { ...options?.labels, placeholder } }) | ||
const handleButtonLabelChange = (button: string) => | ||
onOptionsChange({ ...options, labels: { ...options?.labels, button } }) | ||
const handleMinChange = (min?: number) => | ||
onOptionsChange(removeUndefinedFields({ ...options, min })) | ||
const handleMaxChange = (max?: number) => | ||
onOptionsChange(removeUndefinedFields({ ...options, max })) | ||
const handleStepChange = (step?: number) => | ||
onOptionsChange(removeUndefinedFields({ ...options, step })) | ||
|
||
return ( | ||
<Stack spacing={4}> | ||
<Stack> | ||
<FormLabel mb="0" htmlFor="placeholder"> | ||
Placeholder: | ||
</FormLabel> | ||
<DebouncedInput | ||
id="placeholder" | ||
initialValue={options?.labels?.placeholder ?? 'Type your answer...'} | ||
delay={100} | ||
onChange={handlePlaceholderChange} | ||
/> | ||
</Stack> | ||
<Stack> | ||
<FormLabel mb="0" htmlFor="button"> | ||
Button label: | ||
</FormLabel> | ||
<DebouncedInput | ||
id="button" | ||
initialValue={options?.labels?.button ?? 'Send'} | ||
delay={100} | ||
onChange={handleButtonLabelChange} | ||
/> | ||
</Stack> | ||
<HStack justifyContent="space-between"> | ||
<FormLabel mb="0" htmlFor="min"> | ||
Min: | ||
</FormLabel> | ||
<SmartNumberInput | ||
id="min" | ||
initialValue={options?.min} | ||
onValueChange={handleMinChange} | ||
/> | ||
</HStack> | ||
<HStack justifyContent="space-between"> | ||
<FormLabel mb="0" htmlFor="max"> | ||
Max: | ||
</FormLabel> | ||
<SmartNumberInput | ||
id="max" | ||
initialValue={options?.max} | ||
onValueChange={handleMaxChange} | ||
/> | ||
</HStack> | ||
<HStack justifyContent="space-between"> | ||
<FormLabel mb="0" htmlFor="step"> | ||
Step: | ||
</FormLabel> | ||
<SmartNumberInput | ||
id="step" | ||
initialValue={options?.step} | ||
onValueChange={handleStepChange} | ||
/> | ||
</HStack> | ||
</Stack> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
apps/builder/components/board/graph/BlockNode/StepNode/StepContent.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
d54ebc0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-typebot-io.vercel.app
next.typebot.io
builder-v2-git-main-typebot-io.vercel.app
d54ebc0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
viewer-v2-git-main-typebot-io.vercel.app
viewer-v2-typebot-io.vercel.app
typebot-io.vercel.app