Skip to content

Commit

Permalink
💄 Improve picture choice description UI
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jun 1, 2023
1 parent 537b9fe commit b6e5002
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const DateInputSettings = ({ options, onOptionsChange }: Props) => {
/>
<SwitchWithLabel
label="With time?"
initialValue={options.isRange}
initialValue={options.hasTime}
onCheckChange={handleHasTimeChange}
/>
{options.isRange && (
Expand Down
4 changes: 4 additions & 0 deletions apps/docs/docs/editor/blocks/integrations/google-sheets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ In order to properly work, your spreadsheet must have its first row as a header
alt="Google Analytics block"
/>

## How to add the submission date to my row?

For this, you will need to set a new variable with the value "Today" before the Google Sheets block. Then you can simply use this variable in the Google Sheets block.

## Troubleshooting

The Google sheets block didn't insert or update a row but was supposed to? Make sure to check the [logs](/editor/results). If you still can't figure out what went wrong, shoot me a message using the chat button directly in the tool 👍
36 changes: 33 additions & 3 deletions apps/docs/docs/embed/html-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ There, you can change the container dimensions. Here is a code example:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected].9/dist/web.js'
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initStandard({
typebot: 'my-typebot',
Expand All @@ -32,7 +32,7 @@ Here is an example:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected].9/dist/web.js'
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initPopup({
typebot: 'my-typebot',
Expand Down Expand Up @@ -66,6 +66,36 @@ You can bind these commands on a button element, for example:
<button onclick="Typebot.open()">Contact us</button>
```

### Multiple bots

If you have different bots on the same page you will have to make them distinct with an additional `id` prop:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initStandard({
id: 'bot1'
typebot: 'my-typebot',
})
Typebot.initStandard({
id: 'bot2'
typebot: 'my-typebot-2',
})
</script>

<typebot-standard
id="bot1"
style="width: 100%; height: 600px; "
></typebot-standard>
...
<typebot-standard
id="bot2"
style="width: 100%; height: 600px; "
></typebot-standard>
```

## Bubble

You can get the bubble HTML and Javascript code by clicking on the "HTML & Javascript" button in the "Share" tab of your typebot.
Expand All @@ -74,7 +104,7 @@ Here is an example:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected].9/dist/web.js'
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initBubble({
typebot: 'my-typebot',
Expand Down
6 changes: 3 additions & 3 deletions packages/embeds/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ There, you can change the container dimensions. Here is a code example:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected].9/dist/web.js'
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initStandard({
typebot: 'my-typebot',
Expand All @@ -54,7 +54,7 @@ Here is an example:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected].9/dist/web.js'
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initPopup({
typebot: 'my-typebot',
Expand Down Expand Up @@ -96,7 +96,7 @@ Here is an example:

```html
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected].9/dist/web.js'
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js'
Typebot.initBubble({
typebot: 'my-typebot',
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.0.60",
"version": "0.0.61",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,27 @@ export const MultiplePictureChoice = (props: Props) => {
'flex gap-3 py-2 flex-shrink-0' +
(isEmpty(item.title) && isEmpty(item.description)
? ' justify-center'
: ' pl-4')
: ' px-3')
}
>
<Checkbox
isChecked={selectedItemIds().some(
(selectedItemId) => selectedItemId === item.id
)}
class={item.title || item.description ? 'mt-1' : undefined}
class={
'flex-shrink-0' +
(item.title || item.description ? ' mt-1' : undefined)
}
/>
<Show when={item.title || item.description}>
<div class="flex flex-col gap-1 ">
<Show when={item.title}>
<span class="font-semibold">{item.title}</span>
</Show>
<Show when={item.description}>
<span class="text-sm">{item.description}</span>
<span class="text-sm whitespace-pre-wrap text-left">
{item.description}
</span>
</Show>
</div>
</Show>
Expand Down Expand Up @@ -186,9 +191,10 @@ export const MultiplePictureChoice = (props: Props) => {
(selectedItemId) => selectedItemId === selectedItem.id
)}
class={
selectedItem.title || selectedItem.description
? 'mt-1'
: undefined
'flex-shrink-0' +
(selectedItem.title || selectedItem.description
? ' mt-1'
: undefined)
}
/>
<Show when={selectedItem.title || selectedItem.description}>
Expand All @@ -197,7 +203,9 @@ export const MultiplePictureChoice = (props: Props) => {
<span class="font-semibold">{selectedItem.title}</span>
</Show>
<Show when={selectedItem.description}>
<span class="text-sm">{selectedItem.description}</span>
<span class="text-sm whitespace-pre-wrap text-left">
{selectedItem.description}
</span>
</Show>
</div>
</Show>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const SinglePictureChoice = (props: Props) => {
on:click={handleClick(index())}
data-itemid={item.id}
class={
'flex flex-col typebot-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between ' +
'flex flex-col typebot-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between ' +
(isSvgSrc(item.pictureSrc) ? 'has-svg' : '')
}
>
Expand All @@ -87,7 +87,9 @@ export const SinglePictureChoice = (props: Props) => {
}
>
<span class="font-semibold">{item.title}</span>
<span class="text-sm">{item.description}</span>
<span class="text-sm whitespace-pre-wrap text-left">
{item.description}
</span>
</div>
</button>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/embeds/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.0.60",
"version": "0.0.61",
"description": "React library to display typebots on your website",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

4 comments on commit b6e5002

@vercel
Copy link

@vercel vercel bot commented on b6e5002 Jun 1, 2023

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 b6e5002 Jun 1, 2023

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

app.typebot.io
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on b6e5002 Jun 1, 2023

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 b6e5002 Jun 1, 2023

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

bii.bj
1stop.au
wasap.nl
yobot.me
klujo.com
me.cr8.ai
wachat.io
wassep.io
247987.com
8jours.top
aginap.com
ai.mprs.in
bee.cr8.ai
bot.aws.bj
bot.bbc.bj
cat.cr8.ai
finplex.be
jxi.cr8.ai
nepkit.com
pig.cr8.ai
sat.cr8.ai
wachats.me
wsapio.com
blogely.com
bot.aipr.kr
bot.joof.it
bot.kloo.me
bull.cr8.ai
docs.cr8.ai
icon.cr8.ai
minipost.uk
mole.cr8.ai
team.cr8.ai
wolf.cr8.ai
ai.meant.com
bet7k.online
bot.grace.bj
cinecorn.com
gniorder.com
help.taxt.co
kusamint.com
rhino.cr8.ai
sheep.cr8.ai
snake.cr8.ai
svhm.mprs.in
tiger.cr8.ai
video.cr8.ai
yoda.riku.ai
bot.artiweb.app
bot.devitus.com
bot.jesopizz.it
bot.reeplai.com
bot.renovato.it
bot.scayver.com
bot.tc-mail.com
chat.lalmon.com
chat.sureb4.com
eventhub.com.au
fitness.riku.ai
games.klujo.com
proscale.com.br
sakuranembro.it
sellmycarbr.com
typebot.aloe.do
bot.contakit.com
bot.piccinato.co
bot.sv-energy.it
botc.ceox.com.br
clo.closeer.work
cockroach.cr8.ai
faqs.nigerias.io
form.syncwin.com
haymanevents.com
kw.wpwakanda.com
myrentalhost.com
stan.vselise.com
start.taxtree.io
typebot.aloe.bot
voicehelp.cr8.ai
zap.fundviser.in
app.bouclidom.com
app.chatforms.net
bot.aldoemaria.it
bot.hostnation.de
bot.maitempah.com
bot.phuonghub.com
bot.reviewzer.com
bot.rihabilita.it
bot.uluhub.com.br
cares.urlabout.me
chat.gaswadern.de
chat.gniorder.com
chat.rojie.online
fmm.wpwakanda.com
footballmeetup.ie
gentleman-shop.fr
uppity.wpwakanda.com
83701274.21000000.lol
90945247.21000000.one
abutton.wpwakanda.com

Please sign in to comment.