From 3421e4822f18a6c6071a0ecdd06447d9794e6803 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 11 Jul 2023 10:19:47 +0200 Subject: [PATCH] :ambulance: (bot) Share inject custom head code again --- packages/embeds/js/package.json | 2 +- .../js/src/utils/injectCustomHeadCode.ts | 33 ------------------- .../embeds/js/src/utils/injectStartProps.ts | 3 +- packages/embeds/react/package.json | 2 +- packages/lib/utils.ts | 32 ++++++++++++++++++ 5 files changed, 35 insertions(+), 37 deletions(-) delete mode 100644 packages/embeds/js/src/utils/injectCustomHeadCode.ts diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index be84a8e4b..d7f621999 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.0.71", + "version": "0.0.72", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/utils/injectCustomHeadCode.ts b/packages/embeds/js/src/utils/injectCustomHeadCode.ts deleted file mode 100644 index 56ca5f32d..000000000 --- a/packages/embeds/js/src/utils/injectCustomHeadCode.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { isNotDefined } from '@typebot.io/lib/utils' - -export const injectCustomHeadCode = (customHeadCode: string) => { - customHeadCode = customHeadCode.replace( - /` - ) - const headCodes = customHeadCode.split('') - headCodes.forEach((headCode) => { - const [codeToInject, noScriptContentToInject] = headCode.split('') + headCodes.forEach((headCode) => { + const [codeToInject, noScriptContentToInject] = headCode.split('