Skip to content

Commit

Permalink
🐛 (typebot-js) Fix default export from js lib
Browse files Browse the repository at this point in the history
Closes
  • Loading branch information
baptisteArno committed Nov 9, 2022
1 parent b31b603 commit 8ab67b7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
8 changes: 3 additions & 5 deletions packages/bot-engine/src/services/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,9 @@ const executeCode = async (
if (!block.options.content) return
console.log('isEmbedded', isEmbedded)
if (block.options.shouldExecuteInParentContext && isEmbedded) {
const func = Function(
...variables.map((v) => v.id),
parseVariables(variables)(block.options.content)
)
sendEventToParent({ codeToExecute: func })
sendEventToParent({
codeToExecute: parseVariables(variables)(block.options.content),
})
} else {
const func = Function(
...variables.map((v) => v.id),
Expand Down
2 changes: 1 addition & 1 deletion packages/typebot-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typebot-js",
"version": "2.2.10",
"version": "2.2.11",
"main": "dist/index.js",
"unpkg": "dist/index.umd.min.js",
"license": "AGPL-3.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/typebot-js/src/iframe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ const processMessage = (
if (data.redirectUrl) window.open(data.redirectUrl)
if (data.newVariableValue && callbacks.onNewVariableValue)
callbacks.onNewVariableValue(data.newVariableValue)
if (data.codeToExecute) data.codeToExecute()
if (data.codeToExecute) Function(data.codeToExecute)()
}
18 changes: 13 additions & 5 deletions packages/typebot-js/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { initContainer } from "./embedTypes/container";
import { initPopup, getPopupActions } from "./embedTypes/popup";
import { initBubble, getBubbleActions } from "./embedTypes/chat";
import { initContainer } from './embedTypes/container'
import { initPopup, getPopupActions } from './embedTypes/popup'
import { initBubble, getBubbleActions } from './embedTypes/chat'

export {
initContainer,
initPopup,
initBubble,
getPopupActions,
getBubbleActions,
};
}

export * from "./types";
export default {
initContainer,
initPopup,
initBubble,
getPopupActions,
getBubbleActions,
}

export * from './types'
2 changes: 1 addition & 1 deletion packages/typebot-js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type Variable = {
export type TypebotPostMessageData = {
redirectUrl?: string
newVariableValue?: Variable
codeToExecute?: Function
codeToExecute?: string
}

export const localStorageKeys = {
Expand Down

5 comments on commit 8ab67b7

@vercel
Copy link

@vercel vercel bot commented on 8ab67b7 Nov 9, 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 8ab67b7 Nov 9, 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 8ab67b7 Nov 9, 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 8ab67b7 Nov 9, 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:

viewer-v2-alpha – ./apps/viewer

ns8.vn
yobot.me
247987.com
8jours.top
bot.aws.bj
bot.bbc.bj
finplex.be
sat.cr8.ai
bot.phuonghub.com
bot.reviewzer.com
cares.urlabout.me
fmm.wpwakanda.com
gentleman-shop.fr
k1.kandabrand.com
lb.ticketfute.com
ov1.wpwakanda.com
ov2.wpwakanda.com
ov3.wpwakanda.com
1988.bouclidom.com
andreimayer.com.br
bot.megafox.com.br
bot.neferlopez.com
bots.robomotion.io
cadu.uninta.edu.br
dicanatural.online
goalsettingbot.com
positivobra.com.br
survey.digienge.io
this-is-a-test.com
zap.techadviser.in
bot.digitalbled.com
bot.eventhub.com.au
carsalesenquiry.com
demo.botscientis.us
forms.webisharp.com
kbsub.wpwakanda.com
live.botscientis.us
mentoria.omelhor.vc
nutrisamirbayde.com
order.maitempah.com
quest.wpwakanda.com
test.botscientis.us
typebot.stillio.com
bium.gratirabbit.com
bot.ansuraniphone.my
bot.cotemeuplano.com
chat.hayurihijab.com
chatbee.agfunnel.com
click.sevenoways.com
connect.growthguy.in
get.freebotoffer.xyz
kuiz.sistemniaga.com
offer.botscientis.us
sellmycarglasgow.com
talkbot.agfunnel.com
tenorioadvogados.com
uppity.wpwakanda.com
abutton.wpwakanda.com
aidigitalmarketing.kr
bbutton.wpwakanda.com
bot.incusservices.com
bot.meuesocial.com.br
bot.ramonmatos.com.br
cdd.searchcube.com.sg
chat.missarkansas.org
sbutton.wpwakanda.com
815639944.21000000.one
aplicacao.bmind.com.br
apply.ansuraniphone.my
bbutton.wpwwakanda.com
bot.louismarcondes.com
bot.t20worldcup.com.au
c23111azqw.nigerias.io
felipewelington.com.br
form.searchcube.com.sg
gcase.barrettamario.it
help.giversforgood.com
info.clickasuransi.com
kodawariab736.skeep.it
premium.kandabrand.com
report.gratirabbit.com
resume.gratirabbit.com
view.onlinebotdemo.xyz
83242573.actualizar.xyz
bot.blackboxtips.com.br
bot.upgradesolutions.eu
help.comebackreward.com
mainmenu.diddancing.com
register.kandabrand.com
signup.hypemarketing.in
subfooter.wpwakanda.com
survey.hypemarketing.in
testbot.afterorigin.com
91181264.your-access.one
ai.chromebookstoreph.com
form.sergiolimajr.com.br
hunterbot.saleshunter.ai
link.cascadigital.com.br
onboarding.growthside.io
reward.onlinebotdemo.xyz

@vercel
Copy link

@vercel vercel bot commented on 8ab67b7 Nov 9, 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-typebot-io.vercel.app
docs.typebot.io
docs-git-main-typebot-io.vercel.app

Please sign in to comment.