♻️ (builder) Remove barrel export and flatten folder arch

This commit is contained in:
Baptiste Arnaud
2023-03-15 11:51:30 +01:00
parent cbc8194f19
commit 44d7a0bcb8
498 changed files with 1542 additions and 1786 deletions

View File

@@ -0,0 +1,18 @@
import { Variable } from '@typebot.io/schemas'
export const parseVariableHtmlTags = (
content: string,
variables: Variable[]
) => {
const varNames = variables.map((variable) => variable.name)
return content.replace(/\{\{(.*?)\}\}/g, (fullMatch, foundVar) => {
if (content.includes(`href="{{${foundVar}}}"`)) return fullMatch
if (varNames.some((val) => foundVar === val)) {
return `<span style="background-color:#ff8b1a; color:#ffffff; padding: 0.125rem 0.25rem; border-radius: 0.35rem">${fullMatch.replace(
/{{|}}/g,
''
)}</span>`
}
return fullMatch
})
}

View File

@@ -1 +0,0 @@
export { VariablesButton } from './components/VariablesButton'