2
0

feat(template): 📝 Add Quizz

This commit is contained in:
Baptiste Arnaud
2022-04-08 18:07:14 -05:00
parent 4c9f97b254
commit 5aac8229d2
5 changed files with 997 additions and 10 deletions

View File

@ -8,12 +8,7 @@ export type TemplateProps = {
export const templates: TemplateProps[] = [
{ name: 'Lead Generation', emoji: '🤝', fileName: 'lead-gen.json' },
{ name: 'Customer Support', emoji: '😍', fileName: 'customer-support.json' },
{
name: 'Quiz',
emoji: '🕹️',
fileName: 'customer-support.json',
isComingSoon: true,
},
{ name: 'Quiz', emoji: '🕹️', fileName: 'quiz.json' },
{
name: 'Lead Scoring',
emoji: '🏆',

View File

@ -0,0 +1,986 @@
{
"id": "cl1qz4luj04007w1ai7rk1j5q",
"createdAt": "2022-04-08T22:02:30.427Z",
"updatedAt": "2022-04-08T23:03:34.726Z",
"icon": "🕹️",
"name": "Digital Marketing Quiz",
"ownerId": "cl1qykt2w00007w1agho81e26",
"publishedTypebotId": null,
"folderId": null,
"blocks": [
{
"id": "cl1qz4lui00017w1a505z15p0",
"steps": [
{
"id": "cl1qz4lui00027w1a19prdgzd",
"type": "start",
"label": "Start",
"blockId": "cl1qz4lui00017w1a505z15p0",
"outgoingEdgeId": "cl1r17gv3006h2e6dc9e7xob7"
}
],
"title": "Start",
"graphCoordinates": { "x": -541.1926699141732, "y": -27.363674321503076 }
},
{
"id": "cl1r09bc6000h2e6dqml18p4p",
"steps": [
{
"id": "cl1r0bva2000y2e6d2g88vmjk",
"type": "Set variable",
"blockId": "cl1r09bc6000h2e6dqml18p4p",
"options": {
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"expressionToEvaluate": "0"
}
},
{
"id": "cl1r09bcc000i2e6dyyvskx75",
"type": "text",
"blockId": "cl1r09bc6000h2e6dqml18p4p",
"content": {
"html": "<div>What does SEO stand for?</div>",
"richText": [
{
"type": "p",
"children": [{ "text": "What does SEO stand for?" }]
}
],
"plainText": "What does SEO stand for?"
}
},
{
"id": "cl1r09dl9000j2e6dhkc2h97y",
"type": "choice input",
"items": [
{
"id": "cl1r09dl9000k2e6dvf7llzkd",
"type": 0,
"stepId": "cl1r09dl9000j2e6dhkc2h97y",
"content": "Send Email Out"
},
{
"id": "cl1r0a80k000l2e6dngppwyhm",
"type": 0,
"stepId": "cl1r09dl9000j2e6dhkc2h97y",
"content": "Serial Editorial Output"
},
{
"id": "cl1r0adei000m2e6dfc8w5y4k",
"type": 0,
"stepId": "cl1r09dl9000j2e6dhkc2h97y",
"content": "Search Engine Optimization",
"outgoingEdgeId": "cl1r0dfip00152e6doo9duexn"
},
{
"id": "cl1r0aiks000n2e6dc31e2db6",
"type": 0,
"stepId": "cl1r09dl9000j2e6dhkc2h97y",
"content": "Search Expectation Order"
}
],
"blockId": "cl1r09bc6000h2e6dqml18p4p",
"options": { "buttonLabel": "Send", "isMultipleChoice": false },
"outgoingEdgeId": "cl1r0cfjt00122e6dzwtamycl"
}
],
"title": "Q1",
"graphCoordinates": { "x": 3, "y": 180 }
},
{
"id": "cl1r0b3ww000q2e6d4aihat41",
"steps": [
{
"id": "cl1r0e8gq00172e6dq0bpxqsc",
"type": "Set variable",
"blockId": "cl1r0b3ww000q2e6d4aihat41",
"options": {
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"expressionToEvaluate": "{{Score}} + 5"
}
},
{
"id": "cl1r0d8zi00142e6d4tl2yenk",
"type": "text",
"blockId": "cl1r0b3ww000q2e6d4aihat41",
"content": {
"html": "<div>Well done!</div>",
"richText": [
{ "type": "p", "children": [{ "text": "Well done!" }] }
],
"plainText": "Well done!"
}
},
{
"id": "cl1r0bgit000x2e6dvdre9wsj",
"type": "text",
"blockId": "cl1r0b3ww000q2e6d4aihat41",
"content": {
"html": "<div>What is anchor text?</div>",
"richText": [
{ "type": "p", "children": [{ "text": "What is anchor text?" }] }
],
"plainText": "What is anchor text?"
}
},
{
"id": "cl1r0b3x5000r2e6dqk8gzoim",
"type": "choice input",
"items": [
{
"id": "cl1r0b3x5000s2e6dyq6bklbf",
"type": 0,
"stepId": "cl1r0b3x5000r2e6dqk8gzoim",
"content": "The visible text that is hyperlinked to another page",
"outgoingEdgeId": "cl1r0i4dj001r2e6dgb96tx9q"
},
{
"id": "cl1r0b6jd000t2e6dkp3dxpp9",
"type": 0,
"stepId": "cl1r0b3x5000r2e6dqk8gzoim",
"content": "The text in the top left of a webpage"
},
{
"id": "cl1r0b835000u2e6d22rw2gb5",
"type": 0,
"stepId": "cl1r0b3x5000r2e6dqk8gzoim",
"content": "The most prominent text on a page, used by search engines to assign a title to the page"
},
{
"id": "cl1r0b9tl000v2e6dkligryj3",
"type": 0,
"stepId": "cl1r0b3x5000r2e6dqk8gzoim",
"content": "A slogan that sticks in a consumers mind"
}
],
"blockId": "cl1r0b3ww000q2e6d4aihat41",
"options": { "buttonLabel": "Send", "isMultipleChoice": false },
"outgoingEdgeId": "cl1r0f53y001q2e6dvuq434ru"
}
],
"title": "Q2",
"graphCoordinates": { "x": 457.878775226166, "y": 159.83836696822075 }
},
{
"id": "cl1r0erik00182e6dfzezujj0",
"steps": [
{
"id": "cl1r0eril00192e6d9yrtownz",
"type": "Set variable",
"blockId": "cl1r0erik00182e6dfzezujj0",
"options": {
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"expressionToEvaluate": "{{Score}} + 5"
},
"webhookId": "cl1r0eril001a2e6dv25rx2mr"
},
{
"id": "cl1r0eril001b2e6dh43cqhv5",
"type": "text",
"blockId": "cl1r0erik00182e6dfzezujj0",
"content": {
"html": "<div>Well done!</div>",
"richText": [
{ "type": "p", "children": [{ "text": "Well done!" }] }
],
"plainText": "Well done!"
},
"webhookId": "cl1r0eril001c2e6dbh80qiwd"
},
{
"id": "cl1r0eril001d2e6d3gay9cls",
"type": "text",
"blockId": "cl1r0erik00182e6dfzezujj0",
"content": {
"html": "<div>What is a persona ?</div>",
"richText": [
{ "type": "p", "children": [{ "text": "What is a persona ?" }] }
],
"plainText": "What is a persona ?"
},
"webhookId": "cl1r0eril001e2e6drvndjnle"
},
{
"id": "cl1r0eril001f2e6dk0fd0qpw",
"type": "choice input",
"items": [
{
"id": "cl1r0erim001g2e6d5zzn8q22",
"type": 0,
"stepId": "cl1r0eril001f2e6dk0fd0qpw",
"content": "Your target audience"
},
{
"id": "cl1r0erim001h2e6dnwtiturl",
"type": 0,
"stepId": "cl1r0eril001f2e6dk0fd0qpw",
"content": "Someone who joins your mailing list"
},
{
"id": "cl1r0erim001i2e6dbfhck09o",
"type": 0,
"stepId": "cl1r0eril001f2e6dk0fd0qpw",
"content": "A repeat customer"
},
{
"id": "cl1r0erim001j2e6d2waa3374",
"type": 0,
"stepId": "cl1r0eril001f2e6dk0fd0qpw",
"content": "A fictional representation of a group of customers",
"outgoingEdgeId": "cl1r0k27y00262e6dflgcp3wa"
}
],
"blockId": "cl1r0erik00182e6dfzezujj0",
"options": { "buttonLabel": "Send", "isMultipleChoice": false },
"webhookId": "cl1r0erim001k2e6dhymd2bpa",
"outgoingEdgeId": "cl1r0khb6002c2e6ddssbpj9z"
}
],
"title": "Q3",
"graphCoordinates": { "x": 876.6414289028069, "y": 165.43938761308277 }
},
{
"id": "cl1r0j8u1001t2e6d42mjfcqo",
"steps": [
{
"id": "cl1r0j8u2001u2e6dgdpvrnz5",
"type": "Set variable",
"blockId": "cl1r0j8u1001t2e6d42mjfcqo",
"options": {
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"expressionToEvaluate": "{{Score}} + 5"
},
"webhookId": "cl1r0j8u2001v2e6dgdaoejo7"
},
{
"id": "cl1r0j8u2001w2e6d3wnpzcj5",
"type": "text",
"blockId": "cl1r0j8u1001t2e6d42mjfcqo",
"content": {
"html": "<div>Well done!</div>",
"richText": [
{ "type": "p", "children": [{ "text": "Well done!" }] }
],
"plainText": "Well done!"
},
"webhookId": "cl1r0j8u2001x2e6dwmsdfjc5"
},
{
"id": "cl1r0j8u2001y2e6dr24ieifw",
"type": "text",
"blockId": "cl1r0j8u1001t2e6d42mjfcqo",
"content": {
"html": "<div>What does CTA stand for?</div>",
"richText": [
{
"type": "p",
"children": [{ "text": "What does CTA stand for?" }]
}
],
"plainText": "What does CTA stand for?"
},
"webhookId": "cl1r0j8u2001z2e6d343g7x82"
},
{
"id": "cl1r0j8u200202e6dun2d04gu",
"type": "choice input",
"items": [
{
"id": "cl1r0j8u200212e6dov1xy5m4",
"type": 0,
"stepId": "cl1r0j8u200202e6dun2d04gu",
"content": "Consequence To Advert"
},
{
"id": "cl1r0j8u300222e6dnj0i5fm8",
"type": 0,
"stepId": "cl1r0j8u200202e6dun2d04gu",
"content": "Call To Action",
"outgoingEdgeId": "cl1r0lm4e002m2e6d0g3h9pm7"
},
{
"id": "cl1r0j8u300232e6dxd8abojt",
"type": 0,
"stepId": "cl1r0j8u200202e6dun2d04gu",
"content": "Computer Tracked Actions"
},
{
"id": "cl1r0j8u300242e6d0pki60w6",
"type": 0,
"stepId": "cl1r0j8u200202e6dun2d04gu",
"content": "Characteristic Tracking Advert"
}
],
"blockId": "cl1r0j8u1001t2e6d42mjfcqo",
"options": { "buttonLabel": "Send", "isMultipleChoice": false },
"webhookId": "cl1r0j8u300252e6da9tyu8mr",
"outgoingEdgeId": "cl1r0ktet002i2e6d5sh8gd2b"
}
],
"title": "Q4",
"graphCoordinates": { "x": 1262.7222454186965, "y": 156.27265135699366 }
},
{
"id": "cl1r0c85100102e6d7uohf0cu",
"steps": [
{
"id": "cl1r0c85i00112e6d8iwtrpvb",
"type": "text",
"blockId": "cl1r0c85100102e6d7uohf0cu",
"content": {
"html": "<div>WRONG!</div>",
"richText": [{ "type": "p", "children": [{ "text": "WRONG!" }] }],
"plainText": "WRONG!"
}
},
{
"id": "cl1r0crx600132e6d0u54j506",
"type": "text",
"blockId": "cl1r0c85100102e6d7uohf0cu",
"content": {
"html": "<div>SEO stands for Search Engine Optimization</div>",
"richText": [
{
"type": "p",
"children": [
{ "text": "SEO stands for Search Engine Optimization" }
]
}
],
"plainText": "SEO stands for Search Engine Optimization"
},
"outgoingEdgeId": "cl1r0dibf00162e6dwuvli71j"
}
],
"title": "Q1 - Wrong",
"graphCoordinates": { "x": 172.5253073532824, "y": 1013.0204128972396 }
},
{
"id": "cl1r0exdi001l2e6drdwj3u96",
"steps": [
{
"id": "cl1r0exdi001m2e6d7kge562x",
"type": "text",
"blockId": "cl1r0exdi001l2e6drdwj3u96",
"content": {
"html": "<div>WRONG!</div>",
"richText": [{ "type": "p", "children": [{ "text": "WRONG!" }] }],
"plainText": "WRONG!"
},
"webhookId": "cl1r0exdi001n2e6dnva1ju5y"
},
{
"id": "cl1r0exdi001o2e6d70s7si5y",
"type": "text",
"blockId": "cl1r0exdi001l2e6drdwj3u96",
"content": {
"html": "<div>Anchor text is the visible text that is hyperlinked to another page</div>",
"richText": [
{
"type": "p",
"children": [
{
"text": "Anchor text is the visible text that is hyperlinked to another page"
}
]
}
],
"plainText": "Anchor text is the visible text that is hyperlinked to another page"
},
"webhookId": "cl1r0exdi001p2e6d0eoo46n4",
"outgoingEdgeId": "cl1r0ic5f001s2e6dw777scrq"
}
],
"title": "Q2 - Wrong",
"graphCoordinates": { "x": 636.9595917420552, "y": 991.1969380654137 }
},
{
"id": "cl1r0k3tq00272e6d1fwyajjx",
"steps": [
{
"id": "cl1r0k3tq00282e6dl0av81kz",
"type": "text",
"blockId": "cl1r0k3tq00272e6d1fwyajjx",
"content": {
"html": "<div>WRONG!</div>",
"richText": [{ "type": "p", "children": [{ "text": "WRONG!" }] }],
"plainText": "WRONG!"
},
"webhookId": "cl1r0k3tq00292e6dudt7nu2v"
},
{
"id": "cl1r0k3tq002a2e6dv3s1eb6d",
"type": "text",
"blockId": "cl1r0k3tq00272e6d1fwyajjx",
"content": {
"html": "<div>A persona is a fictional representation of a group of customers</div>",
"richText": [
{
"type": "p",
"children": [
{
"text": "A persona is a fictional representation of a group of customers"
}
]
}
],
"plainText": "A persona is a fictional representation of a group of customers"
},
"webhookId": "cl1r0k3tq002b2e6ducddzol5",
"outgoingEdgeId": "cl1r0l7oa002j2e6dgtx0y1gh"
}
],
"title": "Q3 - Wrong",
"graphCoordinates": { "x": 1050.202041289724, "y": 980.9697981906751 }
},
{
"id": "cl1r0kqof002d2e6doqhpnuqy",
"steps": [
{
"id": "cl1r0kqof002e2e6dzjcw0kvs",
"type": "text",
"blockId": "cl1r0kqof002d2e6doqhpnuqy",
"content": {
"html": "<div>WRONG!</div>",
"richText": [{ "type": "p", "children": [{ "text": "WRONG!" }] }],
"plainText": "WRONG!"
},
"webhookId": "cl1r0kqof002f2e6dbkmt2n47"
},
{
"id": "cl1r0kqog002g2e6dizmxvz64",
"type": "text",
"blockId": "cl1r0kqof002d2e6doqhpnuqy",
"content": {
"html": "<div>Anchor text is the visible text that is hyperlinked to another page</div>",
"richText": [
{
"type": "p",
"children": [
{
"text": "Anchor text is the visible text that is hyperlinked to another page"
}
]
}
],
"plainText": "Anchor text is the visible text that is hyperlinked to another page"
},
"webhookId": "cl1r0kqog002h2e6divrrpeu2",
"outgoingEdgeId": "cl1r0p4my00312e6d1wsgwohi"
}
],
"title": "Q4 - Wrong",
"graphCoordinates": { "x": 1443.1059151009042, "y": 986.0153096729298 }
},
{
"id": "cl1r0lfb5002k2e6dd6as5kj5",
"steps": [
{
"id": "cl1r0lo97002n2e6dfx7fohju",
"type": "Set variable",
"blockId": "cl1r0lfb5002k2e6dd6as5kj5",
"options": {
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"expressionToEvaluate": "{{Score}} + 5"
},
"webhookId": "cl1r0lo97002o2e6dtegt9gxn"
},
{
"id": "cl1r0oqrr002y2e6dsg0sa64g",
"type": "Condition",
"items": [
{
"id": "cl1r0oqrr002z2e6dl821aaow",
"type": 1,
"stepId": "cl1r0oqrr002y2e6dsg0sa64g",
"content": {
"comparisons": [
{
"id": "cl1r0osjs00302e6dc60nuk4y",
"value": "14",
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"comparisonOperator": "Greater than"
}
],
"logicalOperator": "AND"
},
"outgoingEdgeId": "cl1r0rt88003a2e6dgq6beaq1"
}
],
"blockId": "cl1r0lfb5002k2e6dd6as5kj5"
},
{
"id": "cl1r0qvwy00342e6d7ww0oqar",
"type": "Condition",
"items": [
{
"id": "cl1r0qvwy00352e6dui5itgd1",
"type": 1,
"stepId": "cl1r0qvwy00342e6d7ww0oqar",
"content": {
"comparisons": [
{
"id": "cl1r0qx3k00362e6dg30jgpdt",
"value": "9",
"variableId": "vcl1r0bxdj000z2e6d65u7n41b",
"comparisonOperator": "Greater than"
}
],
"logicalOperator": "AND"
},
"outgoingEdgeId": "cl1r0s6qt003d2e6d5tk2um7y"
}
],
"blockId": "cl1r0lfb5002k2e6dd6as5kj5",
"outgoingEdgeId": "cl1r0sg9m003i2e6dbsc4cqjn"
}
],
"title": "Filter",
"graphCoordinates": { "x": 1625.4393876130825, "y": 163.71203897007632 }
},
{
"id": "cl1r0mn2p002p2e6dijqbjzlh",
"steps": [
{
"id": "cl1r0mn3t002q2e6dcmv4bzth",
"type": "text",
"blockId": "cl1r0mn2p002p2e6dijqbjzlh",
"content": {
"html": "<div>Your score is {{Score}}/20.</div>",
"richText": [
{
"type": "p",
"children": [{ "text": "Your score is {{Score}}/20." }]
}
],
"plainText": "Your score is {{Score}}/20."
}
},
{
"id": "cl1r0nkdx002r2e6dwv0wclo0",
"type": "text",
"blockId": "cl1r0mn2p002p2e6dijqbjzlh",
"content": {
"html": "<div>Try again?</div>",
"richText": [
{ "type": "p", "children": [{ "text": "Try again?" }] }
],
"plainText": "Try again?"
}
},
{
"id": "cl1r0nt85002s2e6dloupnhdq",
"type": "choice input",
"items": [
{
"id": "cl1r0nt85002t2e6dvb7si7ny",
"type": 0,
"stepId": "cl1r0nt85002s2e6dloupnhdq",
"content": "Yes!",
"outgoingEdgeId": "cl1r15gko005i2e6dn6rhifwe"
},
{
"id": "cl1r0nveb002u2e6dotjk6nuf",
"type": 0,
"stepId": "cl1r0nt85002s2e6dloupnhdq",
"content": "No, bye!"
}
],
"blockId": "cl1r0mn2p002p2e6dijqbjzlh",
"options": { "buttonLabel": "Send", "isMultipleChoice": false }
}
],
"title": "Result",
"graphCoordinates": { "x": 2508.594129051806, "y": 405.664166830421 }
},
{
"id": "cl1r0rgex00382e6dkayjbys6",
"steps": [
{
"id": "cl1r0rggf00392e6dcc941700",
"type": "text",
"blockId": "cl1r0rgex00382e6dkayjbys6",
"content": {
"html": "<div>Well done 👏</div>",
"richText": [
{ "type": "p", "children": [{ "text": "Well done 👏" }] }
],
"plainText": "Well done 👏"
},
"outgoingEdgeId": "cl1r0s9g8003e2e6d5if2ywz9"
}
],
"title": "Great score",
"graphCoordinates": { "x": 1999.3257458460557, "y": 159.39109793689235 }
},
{
"id": "cl1r0rvak003b2e6dejcdrooq",
"steps": [
{
"id": "cl1r0rvce003c2e6diusd3pxq",
"type": "text",
"blockId": "cl1r0rvak003b2e6dejcdrooq",
"content": {
"html": "<div>You could do better but that&#x27;s alright!</div>",
"richText": [
{
"type": "p",
"children": [
{ "text": "You could do better but that's alright!" }
]
}
],
"plainText": "You could do better but that's alright!"
},
"outgoingEdgeId": "cl1r0sarx003f2e6dbzmed9te"
}
],
"title": "Medium score",
"graphCoordinates": { "x": 2008.4469706198897, "y": 315.9721232210492 }
},
{
"id": "cl1r0seuj003h2e6dandwc43r",
"steps": [
{
"id": "cl1r0pe0x00332e6dxg6xdt2f",
"type": "text",
"blockId": "cl1r0seuj003h2e6dandwc43r",
"content": {
"html": "<div>Aouch, you need to improve your Digital Marketing game.</div>",
"richText": [
{
"type": "p",
"children": [
{
"text": "Aouch, you need to improve your Digital Marketing game."
}
]
}
],
"plainText": "Aouch, you need to improve your Digital Marketing game."
},
"outgoingEdgeId": "cl1r0sbzh003g2e6dsqs48aoz"
}
],
"title": "Bad score",
"graphCoordinates": { "x": 2009.9671747488621, "y": 499.91682282670894 }
},
{
"id": "cl1r15f68005f2e6dvdtal7cp",
"steps": [
{
"id": "cl1r15f87005g2e6dp3srll8r",
"type": "Typebot link",
"blockId": "cl1r15f68005f2e6dvdtal7cp",
"options": {
"blockId": "cl1r09bc6000h2e6dqml18p4p",
"typebotId": "current"
}
}
],
"title": "Restart",
"graphCoordinates": { "x": 2850.766985281865, "y": 609.1892251509271 }
},
{
"id": "cl1r15w3o005s2e6dr5l7csao",
"steps": [
{
"id": "cl1r16nes005z2e6d3aj23kfz",
"type": "text",
"blockId": "cl1r15w3o005s2e6dr5l7csao",
"content": {
"html": "<div>Hi there!</div>",
"richText": [
{ "type": "p", "children": [{ "text": "Hi there!" }] }
],
"plainText": "Hi there!"
}
},
{
"id": "cl1r15w5p005t2e6d670v9nbi",
"type": "text",
"blockId": "cl1r15w3o005s2e6dr5l7csao",
"content": {
"html": "<div>You&#x27;re about to answer a Quiz about Digital Marketing</div>",
"richText": [
{
"type": "p",
"children": [
{
"text": "You're about to answer a Quiz about Digital Marketing"
}
]
}
],
"plainText": "You're about to answer a Quiz about Digital Marketing"
}
},
{
"id": "cl1r16rt400622e6d32uta7mi",
"type": "text",
"blockId": "cl1r15w3o005s2e6dr5l7csao",
"content": {
"html": "<div>It is composed of only 4 questions.</div>",
"richText": [
{
"type": "p",
"children": [{ "text": "It is composed of only 4 questions." }]
}
],
"plainText": "It is composed of only 4 questions."
}
},
{
"id": "cl1r1708n00662e6dv8900ixk",
"type": "text",
"blockId": "cl1r15w3o005s2e6dr5l7csao",
"content": {
"html": "<div><span class=\"slate-bold\">Ready?</span></div>",
"richText": [
{ "type": "p", "children": [{ "bold": true, "text": "Ready?" }] }
],
"plainText": "Ready?"
}
},
{
"id": "cl1r176e900692e6d8u3k6sdq",
"type": "choice input",
"items": [
{
"id": "cl1r176e9006a2e6dpvp0974z",
"type": 0,
"stepId": "cl1r176e900692e6d8u3k6sdq",
"content": "Go!",
"outgoingEdgeId": "cl1r17pzv006n2e6dpibxp9th"
}
],
"blockId": "cl1r15w3o005s2e6dr5l7csao",
"options": { "buttonLabel": "Send", "isMultipleChoice": false }
}
],
"title": "Welcome",
"graphCoordinates": { "x": -361.5512664480758, "y": 166.99211858175423 }
}
],
"variables": [{ "id": "vcl1r0bxdj000z2e6d65u7n41b", "name": "Score" }],
"edges": [
{
"id": "cl1r0cfjt00122e6dzwtamycl",
"to": { "blockId": "cl1r0c85100102e6d7uohf0cu" },
"from": {
"stepId": "cl1r09dl9000j2e6dhkc2h97y",
"blockId": "cl1r09bc6000h2e6dqml18p4p"
}
},
{
"id": "cl1r0dfip00152e6doo9duexn",
"to": { "blockId": "cl1r0b3ww000q2e6d4aihat41" },
"from": {
"itemId": "cl1r0adei000m2e6dfc8w5y4k",
"stepId": "cl1r09dl9000j2e6dhkc2h97y",
"blockId": "cl1r09bc6000h2e6dqml18p4p"
}
},
{
"id": "cl1r0dibf00162e6dwuvli71j",
"to": {
"stepId": "cl1r0bgit000x2e6dvdre9wsj",
"blockId": "cl1r0b3ww000q2e6d4aihat41"
},
"from": {
"stepId": "cl1r0crx600132e6d0u54j506",
"blockId": "cl1r0c85100102e6d7uohf0cu"
}
},
{
"id": "cl1r0f53y001q2e6dvuq434ru",
"to": { "blockId": "cl1r0exdi001l2e6drdwj3u96" },
"from": {
"stepId": "cl1r0b3x5000r2e6dqk8gzoim",
"blockId": "cl1r0b3ww000q2e6d4aihat41"
}
},
{
"id": "cl1r0i4dj001r2e6dgb96tx9q",
"to": { "blockId": "cl1r0erik00182e6dfzezujj0" },
"from": {
"itemId": "cl1r0b3x5000s2e6dyq6bklbf",
"stepId": "cl1r0b3x5000r2e6dqk8gzoim",
"blockId": "cl1r0b3ww000q2e6d4aihat41"
}
},
{
"id": "cl1r0ic5f001s2e6dw777scrq",
"to": {
"stepId": "cl1r0eril001d2e6d3gay9cls",
"blockId": "cl1r0erik00182e6dfzezujj0"
},
"from": {
"stepId": "cl1r0exdi001o2e6d70s7si5y",
"blockId": "cl1r0exdi001l2e6drdwj3u96"
}
},
{
"id": "cl1r0k27y00262e6dflgcp3wa",
"to": { "blockId": "cl1r0j8u1001t2e6d42mjfcqo" },
"from": {
"itemId": "cl1r0erim001j2e6d2waa3374",
"stepId": "cl1r0eril001f2e6dk0fd0qpw",
"blockId": "cl1r0erik00182e6dfzezujj0"
}
},
{
"id": "cl1r0khb6002c2e6ddssbpj9z",
"to": { "blockId": "cl1r0k3tq00272e6d1fwyajjx" },
"from": {
"stepId": "cl1r0eril001f2e6dk0fd0qpw",
"blockId": "cl1r0erik00182e6dfzezujj0"
}
},
{
"id": "cl1r0ktet002i2e6d5sh8gd2b",
"to": { "blockId": "cl1r0kqof002d2e6doqhpnuqy" },
"from": {
"stepId": "cl1r0j8u200202e6dun2d04gu",
"blockId": "cl1r0j8u1001t2e6d42mjfcqo"
}
},
{
"id": "cl1r0l7oa002j2e6dgtx0y1gh",
"to": {
"stepId": "cl1r0j8u2001y2e6dr24ieifw",
"blockId": "cl1r0j8u1001t2e6d42mjfcqo"
},
"from": {
"stepId": "cl1r0k3tq002a2e6dv3s1eb6d",
"blockId": "cl1r0k3tq00272e6d1fwyajjx"
}
},
{
"id": "cl1r0lm4e002m2e6d0g3h9pm7",
"to": { "blockId": "cl1r0lfb5002k2e6dd6as5kj5" },
"from": {
"itemId": "cl1r0j8u300222e6dnj0i5fm8",
"stepId": "cl1r0j8u200202e6dun2d04gu",
"blockId": "cl1r0j8u1001t2e6d42mjfcqo"
}
},
{
"id": "cl1r0p4my00312e6d1wsgwohi",
"to": {
"stepId": "cl1r0oqrr002y2e6dsg0sa64g",
"blockId": "cl1r0lfb5002k2e6dd6as5kj5"
},
"from": {
"stepId": "cl1r0kqog002g2e6dizmxvz64",
"blockId": "cl1r0kqof002d2e6doqhpnuqy"
}
},
{
"id": "cl1r0rt88003a2e6dgq6beaq1",
"to": { "blockId": "cl1r0rgex00382e6dkayjbys6" },
"from": {
"itemId": "cl1r0oqrr002z2e6dl821aaow",
"stepId": "cl1r0oqrr002y2e6dsg0sa64g",
"blockId": "cl1r0lfb5002k2e6dd6as5kj5"
}
},
{
"id": "cl1r0s6qt003d2e6d5tk2um7y",
"to": { "blockId": "cl1r0rvak003b2e6dejcdrooq" },
"from": {
"itemId": "cl1r0qvwy00352e6dui5itgd1",
"stepId": "cl1r0qvwy00342e6d7ww0oqar",
"blockId": "cl1r0lfb5002k2e6dd6as5kj5"
}
},
{
"id": "cl1r0s9g8003e2e6d5if2ywz9",
"to": { "blockId": "cl1r0mn2p002p2e6dijqbjzlh" },
"from": {
"stepId": "cl1r0rggf00392e6dcc941700",
"blockId": "cl1r0rgex00382e6dkayjbys6"
}
},
{
"id": "cl1r0sarx003f2e6dbzmed9te",
"to": { "blockId": "cl1r0mn2p002p2e6dijqbjzlh" },
"from": {
"stepId": "cl1r0rvce003c2e6diusd3pxq",
"blockId": "cl1r0rvak003b2e6dejcdrooq"
}
},
{
"id": "cl1r0sbzh003g2e6dsqs48aoz",
"to": { "blockId": "cl1r0mn2p002p2e6dijqbjzlh" },
"from": {
"stepId": "cl1r0pe0x00332e6dxg6xdt2f",
"blockId": "cl1r0seuj003h2e6dandwc43r"
}
},
{
"id": "cl1r0sg9m003i2e6dbsc4cqjn",
"to": { "blockId": "cl1r0seuj003h2e6dandwc43r" },
"from": {
"stepId": "cl1r0qvwy00342e6d7ww0oqar",
"blockId": "cl1r0lfb5002k2e6dd6as5kj5"
}
},
{
"id": "cl1r15gko005i2e6dn6rhifwe",
"to": { "blockId": "cl1r15f68005f2e6dvdtal7cp" },
"from": {
"itemId": "cl1r0nt85002t2e6dvb7si7ny",
"stepId": "cl1r0nt85002s2e6dloupnhdq",
"blockId": "cl1r0mn2p002p2e6dijqbjzlh"
}
},
{
"id": "cl1r17gv3006h2e6dc9e7xob7",
"to": { "blockId": "cl1r15w3o005s2e6dr5l7csao" },
"from": {
"stepId": "cl1qz4lui00027w1a19prdgzd",
"blockId": "cl1qz4lui00017w1a505z15p0"
}
},
{
"id": "cl1r17pzv006n2e6dpibxp9th",
"to": { "blockId": "cl1r09bc6000h2e6dqml18p4p" },
"from": {
"itemId": "cl1r176e9006a2e6dpvp0974z",
"stepId": "cl1r176e900692e6d8u3k6sdq",
"blockId": "cl1r15w3o005s2e6dr5l7csao"
}
}
],
"theme": {
"chat": {
"inputs": {
"color": "#303235",
"backgroundColor": "#FFFFFF",
"placeholderColor": "#9095A0"
},
"buttons": { "color": "#FFFFFF", "backgroundColor": "#0042DA" },
"hostAvatar": {
"url": "https://lh3.googleusercontent.com/a-/AOh14GhZu4OG2Brh1TgRjJQYMLKTPuA6NE5viARvKsM5bw=s96-c",
"isEnabled": true
},
"hostBubbles": { "color": "#303235", "backgroundColor": "#F7F8FF" },
"guestBubbles": { "color": "#FFFFFF", "backgroundColor": "#FF8E21" }
},
"general": { "font": "Open Sans", "background": { "type": "None" } }
},
"settings": {
"general": {
"isBrandingEnabled": true,
"isInputPrefillEnabled": true,
"isNewResultOnRefreshEnabled": false
},
"metadata": {
"description": "Build beautiful conversational forms and embed them directly in your applications without a line of code. Triple your response rate and collect answers that has more value compared to a traditional form."
},
"typingEmulation": { "speed": 300, "enabled": true, "maxDelay": 1.5 }
},
"publicId": null,
"customDomain": null
}

View File

@ -66,7 +66,11 @@ export const InputChatStep = ({
{hasAvatar && (
<div className="flex w-6 xs:w-10 h-6 xs:h-10 mr-2 mb-2 mt-1 flex-shrink-0 items-center" />
)}
<Input step={step} onSubmit={handleSubmit} defaultValue={defaultValue} />
<Input
step={step}
onSubmit={handleSubmit}
defaultValue={defaultValue?.toString()}
/>
</div>
)
}

View File

@ -18,7 +18,9 @@ export const parseVariables =
})
if (!variable) return ''
return (
(options.fieldToParse === 'value' ? variable.value : variable.id) || ''
(options.fieldToParse === 'value'
? variable.value?.toString()
: variable.id) || ''
)
})
}
@ -32,7 +34,7 @@ export const evaluateExpression = (variables: Variable[]) => (str: string) => {
)
)
const evaluatedResult = func(...variables.map((v) => v.value))
return isNotDefined(evaluatedResult) ? '' : evaluatedResult.toString()
return isNotDefined(evaluatedResult) ? '' : evaluatedResult
} catch (err) {
console.log(err)
return str

View File

@ -1,7 +1,7 @@
export type Variable = {
id: string
name: string
value?: string
value?: string | number
}
export type VariableWithValue = Omit<Variable, 'value'> & {