Skip to content

Commit

Permalink
build: 📦️ Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed May 13, 2022
1 parent ddaaa68 commit 6c29865
Show file tree
Hide file tree
Showing 32 changed files with 3,078 additions and 3,773 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const CustomDomainsDropdown = ({
textAlign="left"
{...props}
>
<Text isTruncated overflowY="visible" h="20px">
<Text noOfLines={0} overflowY="visible" h="20px">
{currentCustomDomain ?? 'Add my domain'}
</Text>
</MenuButton>
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/components/shared/CredentialsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const CredentialsDropdown = ({
textAlign="left"
{...props}
>
<Text isTruncated overflowY="visible" h="20px">
<Text noOfLines={0} overflowY="visible" h="20px">
{currentCredential ? currentCredential.name : defaultCredentialsLabel}
</Text>
</MenuButton>
Expand Down
8 changes: 4 additions & 4 deletions apps/builder/components/shared/DropdownList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Stack,
} from '@chakra-ui/react'
import { ChevronLeftIcon } from 'assets/icons'
import React from 'react'
import React, { ReactNode } from 'react'

type Props<T> = {
currentItem?: T
Expand Down Expand Up @@ -39,8 +39,8 @@ export const DropdownList = <T,>({
textAlign="left"
{...props}
>
<chakra.span isTruncated display="block">
{currentItem ?? placeholder}
<chakra.span noOfLines={0} display="block">
{(currentItem ?? placeholder) as unknown as ReactNode}
</chakra.span>
</MenuButton>
<Portal>
Expand All @@ -55,7 +55,7 @@ export const DropdownList = <T,>({
textOverflow="ellipsis"
onClick={handleMenuItemClick(item)}
>
{item}
{item as unknown as ReactNode}
</MenuItem>
))}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ConditionNodeContent = ({ item }: Props) => {
byId(comparison.variableId)
)
return (
<Wrap key={comparison.id} spacing={1} isTruncated>
<Wrap key={comparison.id} spacing={1} noOfLines={0}>
{idx > 0 && <Text>{item.content.logicalOperator ?? ''}</Text>}
{variable?.name && (
<Tag bgColor="orange.400" color="white">
Expand All @@ -38,7 +38,7 @@ export const ConditionNodeContent = ({ item }: Props) => {
)}
{comparison?.value && (
<Tag bgColor={'gray.200'}>
<Text isTruncated>{comparison.value}</Text>
<Text noOfLines={0}>{comparison.value}</Text>
</Tag>
)}
</Wrap>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Flex, FlexProps } from '@chakra-ui/react'
import { Item } from 'models'
import React from 'react'
import React, { ReactNode } from 'react'

type Props = {
item: Item
Expand All @@ -20,7 +20,7 @@ export const ItemNodeOverlay = ({ item, ...props }: Props) => {
shadow="lg"
{...props}
>
{item.content ?? 'Click to edit'}
{(item.content ?? 'Click to edit') as ReactNode}
</Flex>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Text } from '@chakra-ui/react'
type Props = { label?: string }

export const ConfigureContent = ({ label }: Props) => (
<Text color={label ? 'currentcolor' : 'gray.500'} isTruncated>
<Text color={label ? 'currentcolor' : 'gray.500'} noOfLines={0}>
{label ?? 'Configure...'}
</Text>
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const SendEmailContent = ({ step }: Props) => {
if (step.options.recipients.length === 0)
return <Text color="gray.500">Configure...</Text>
return (
<Wrap isTruncated pr="6">
<Wrap noOfLines={2} pr="6">
<WrapItem>
<Text>Send email to</Text>
</WrapItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const SetVariableContent = ({ step }: { step: SetVariableStep }) => {
typebot?.variables.find(byId(step.options.variableId))?.name ?? ''
const expression = step.options.expressionToEvaluate ?? ''
return (
<Text color={'gray.500'} isTruncated>
<Text color={'gray.500'} noOfLines={2}>
{variableName === '' && expression === ''
? 'Click to edit...'
: `${variableName} ${expression ? `= ${expression}` : ``}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const WebhookContent = ({ step: { webhookId } }: Props) => {

if (!webhook?.url) return <Text color="gray.500">Configure...</Text>
return (
<Text isTruncated pr="6">
<Text noOfLines={2} pr="6">
{webhook.method} {webhook.url}
</Text>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const ProviderWebhookContent = ({ step, configuredLabel }: Props) => {
if (isNotDefined(webhook?.body))
return <Text color="gray.500">Configure...</Text>
return (
<Text isTruncated pr="6">
<Text noOfLines={0} pr="6">
{webhook?.url ? configuredLabel : 'Disabled'}
</Text>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,32 @@ import {
Plate,
selectEditor,
serializeHtml,
TDescendant,
TEditor,
TElement,
Value,
withPlate,
} from '@udecode/plate-core'
import { editorStyle, platePlugins } from 'libs/plate'
import { BaseSelection, createEditor, Transforms } from 'slate'
import { BaseEditor, BaseSelection, createEditor, Transforms } from 'slate'
import { ToolBar } from './ToolBar'
import { parseHtmlStringToPlainText } from 'services/utils'
import { defaultTextBubbleContent, TextBubbleContent, Variable } from 'models'
import { VariableSearchInput } from 'components/shared/VariableSearchInput'
import { ReactEditor } from 'slate-react'

type Props = {
initialValue: TDescendant[]
initialValue: TElement[]
onClose: (newContent: TextBubbleContent) => void
}

export const TextBubbleEditor = ({ initialValue, onClose }: Props) => {
const randomEditorId = useMemo(() => Math.random().toString(), [])
const editor = useMemo(
() =>
withPlate(createEditor(), { id: randomEditorId, plugins: platePlugins }),
withPlate(createEditor() as TEditor<Value>, {
id: randomEditorId,
plugins: platePlugins,
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
)
Expand Down Expand Up @@ -65,7 +70,7 @@ export const TextBubbleEditor = ({ initialValue, onClose }: Props) => {
}
}

const convertValueToStepContent = (value: unknown[]): TextBubbleContent => {
const convertValueToStepContent = (value: TElement[]): TextBubbleContent => {
if (value.length === 0) defaultTextBubbleContent
const html = serializeHtml(editor, {
nodes: value,
Expand All @@ -84,12 +89,12 @@ export const TextBubbleEditor = ({ initialValue, onClose }: Props) => {
const handleVariableSelected = (variable?: Variable) => {
setIsVariableDropdownOpen(false)
if (!rememberedSelection.current || !variable) return
Transforms.select(editor, rememberedSelection.current)
Transforms.insertText(editor, '{{' + variable.name + '}}')
Transforms.select(editor as BaseEditor, rememberedSelection.current)
Transforms.insertText(editor as BaseEditor, '{{' + variable.name + '}}')
ReactEditor.focus(editor as unknown as ReactEditor)
}

const handleChangeEditorContent = (val: unknown[]) => {
const handleChangeEditorContent = (val: TElement[]) => {
setValue(val)
setIsVariableDropdownOpen(false)
}
Expand All @@ -110,7 +115,10 @@ export const TextBubbleEditor = ({ initialValue, onClose }: Props) => {
spacing={0}
cursor="text"
>
<ToolBar onVariablesButtonClick={() => setIsVariableDropdownOpen(true)} />
<ToolBar
editor={editor}
onVariablesButtonClick={() => setIsVariableDropdownOpen(true)}
/>
<Plate
id={randomEditorId}
editableProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ import {
MARK_ITALIC,
MARK_UNDERLINE,
} from '@udecode/plate-basic-marks'
import { usePlateEditorRef, getPluginType } from '@udecode/plate-core'
import { getPluginType, PlateEditor, Value } from '@udecode/plate-core'
import { LinkToolbarButton } from '@udecode/plate-ui-link'
import { MarkToolbarButton } from '@udecode/plate-ui-toolbar'
import { BoldIcon, ItalicIcon, UnderlineIcon, LinkIcon } from 'assets/icons'

type Props = { onVariablesButtonClick: () => void } & StackProps
export const ToolBar = (props: Props) => {
const editor = usePlateEditorRef()
type Props = {
editor: PlateEditor<Value>
onVariablesButtonClick: () => void
} & StackProps

export const ToolBar = ({
editor,
onVariablesButtonClick,
...props
}: Props) => {
const handleVariablesButtonMouseDown = (e: React.MouseEvent) => {
e.preventDefault()
props.onVariablesButtonClick()
onVariablesButtonClick()
}
return (
<HStack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export const CollaboratorIdentityContent = ({
{name}
</Text>
)}
<Text color="gray.500" fontSize={name ? '14px' : 'inherit'} isTruncated>
<Text
color="gray.500"
fontSize={name ? '14px' : 'inherit'}
noOfLines={0}
>
{email}
</Text>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const EditableTypebotName = ({ name, onNewName }: EditableProps) => {
<Tooltip label="Rename">
<Editable value={localName} onChange={setLocalName} onSubmit={onNewName}>
<EditablePreview
isTruncated
noOfLines={0}
cursor="pointer"
maxW="200px"
overflow="hidden"
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/layouts/results/SubmissionContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const SubmissionsContent = ({
() =>
publishedTypebot ? convertResultsToTableData(results, resultHeader) : [],
// eslint-disable-next-line react-hooks/exhaustive-deps
[results]
[publishedTypebot?.id, resultHeader.length, results]
)

const handleLogsModalClose = () => setInspectingLogsResultId(undefined)
Expand Down
Loading

5 comments on commit 6c29865

@vercel
Copy link

@vercel vercel bot commented on 6c29865 May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 6c29865 May 13, 2022

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:

docs – ./apps/docs

docs-git-main-typebot-io.vercel.app
docs-typebot-io.vercel.app
docs.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 6c29865 May 13, 2022

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
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 6c29865 May 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.