🐛 (typebot-js) Fix default export from js lib
Closes
This commit is contained in:
@ -169,11 +169,9 @@ const executeCode = async (
|
|||||||
if (!block.options.content) return
|
if (!block.options.content) return
|
||||||
console.log('isEmbedded', isEmbedded)
|
console.log('isEmbedded', isEmbedded)
|
||||||
if (block.options.shouldExecuteInParentContext && isEmbedded) {
|
if (block.options.shouldExecuteInParentContext && isEmbedded) {
|
||||||
const func = Function(
|
sendEventToParent({
|
||||||
...variables.map((v) => v.id),
|
codeToExecute: parseVariables(variables)(block.options.content),
|
||||||
parseVariables(variables)(block.options.content)
|
})
|
||||||
)
|
|
||||||
sendEventToParent({ codeToExecute: func })
|
|
||||||
} else {
|
} else {
|
||||||
const func = Function(
|
const func = Function(
|
||||||
...variables.map((v) => v.id),
|
...variables.map((v) => v.id),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "typebot-js",
|
"name": "typebot-js",
|
||||||
"version": "2.2.10",
|
"version": "2.2.11",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"unpkg": "dist/index.umd.min.js",
|
"unpkg": "dist/index.umd.min.js",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
@ -62,5 +62,5 @@ const processMessage = (
|
|||||||
if (data.redirectUrl) window.open(data.redirectUrl)
|
if (data.redirectUrl) window.open(data.redirectUrl)
|
||||||
if (data.newVariableValue && callbacks.onNewVariableValue)
|
if (data.newVariableValue && callbacks.onNewVariableValue)
|
||||||
callbacks.onNewVariableValue(data.newVariableValue)
|
callbacks.onNewVariableValue(data.newVariableValue)
|
||||||
if (data.codeToExecute) data.codeToExecute()
|
if (data.codeToExecute) Function(data.codeToExecute)()
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { initContainer } from "./embedTypes/container";
|
import { initContainer } from './embedTypes/container'
|
||||||
import { initPopup, getPopupActions } from "./embedTypes/popup";
|
import { initPopup, getPopupActions } from './embedTypes/popup'
|
||||||
import { initBubble, getBubbleActions } from "./embedTypes/chat";
|
import { initBubble, getBubbleActions } from './embedTypes/chat'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
initContainer,
|
initContainer,
|
||||||
@ -8,6 +8,14 @@ export {
|
|||||||
initBubble,
|
initBubble,
|
||||||
getPopupActions,
|
getPopupActions,
|
||||||
getBubbleActions,
|
getBubbleActions,
|
||||||
};
|
}
|
||||||
|
|
||||||
export * from "./types";
|
export default {
|
||||||
|
initContainer,
|
||||||
|
initPopup,
|
||||||
|
initBubble,
|
||||||
|
getPopupActions,
|
||||||
|
getBubbleActions,
|
||||||
|
}
|
||||||
|
|
||||||
|
export * from './types'
|
||||||
|
@ -54,7 +54,7 @@ export type Variable = {
|
|||||||
export type TypebotPostMessageData = {
|
export type TypebotPostMessageData = {
|
||||||
redirectUrl?: string
|
redirectUrl?: string
|
||||||
newVariableValue?: Variable
|
newVariableValue?: Variable
|
||||||
codeToExecute?: Function
|
codeToExecute?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const localStorageKeys = {
|
export const localStorageKeys = {
|
||||||
|
Reference in New Issue
Block a user