diff --git a/apps/builder/.prettierignore b/apps/builder/.prettierignore index bd0a36066..e6620fe85 100644 --- a/apps/builder/.prettierignore +++ b/apps/builder/.prettierignore @@ -1,2 +1,3 @@ emojiList.json -iconNames.ts \ No newline at end of file +iconNames.ts +reporters \ No newline at end of file diff --git a/apps/builder/src/features/editor/providers/typebotActions/groups.ts b/apps/builder/src/features/editor/providers/typebotActions/groups.ts index 0e45e7d4a..34fc60cda 100644 --- a/apps/builder/src/features/editor/providers/typebotActions/groups.ts +++ b/apps/builder/src/features/editor/providers/typebotActions/groups.ts @@ -153,7 +153,6 @@ const groupsActions = (setTypebot: SetTypebot): GroupsActions => ({ let outgoingEdgeId = item.outgoingEdgeId if (outgoingEdgeId) { const edge = edges.find(byId(outgoingEdgeId)) - console.log(edge) if (edge) { outgoingEdgeId = createId() edgesToCreate.push({ diff --git a/packages/embeds/js/package.json b/packages/embeds/js/package.json index 6ab41dbdc..d967da1b9 100644 --- a/packages/embeds/js/package.json +++ b/packages/embeds/js/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/js", - "version": "0.2.37", + "version": "0.2.38", "description": "Javascript library to display typebots on your website", "type": "module", "main": "dist/index.js", diff --git a/packages/embeds/js/src/features/blocks/bubbles/textBubble/components/plate/PlateBlock.tsx b/packages/embeds/js/src/features/blocks/bubbles/textBubble/components/plate/PlateBlock.tsx index 7081b8780..dfd4dd5df 100644 --- a/packages/embeds/js/src/features/blocks/bubbles/textBubble/components/plate/PlateBlock.tsx +++ b/packages/embeds/js/src/features/blocks/bubbles/textBubble/components/plate/PlateBlock.tsx @@ -1,13 +1,11 @@ import type { TElement, TText, TDescendant } from '@udecode/plate-common' import { PlateText, PlateTextProps } from './PlateText' -import { For, Match, Switch, JSXElement } from 'solid-js' +import { For, Match, Switch } from 'solid-js' import { isDefined } from '@typebot.io/lib/utils' -import clsx from 'clsx' type Props = { element: TElement | TText isUniqueChild?: boolean - inElement?: boolean } export const PlateElement = (props: Props) => ( @@ -33,7 +31,6 @@ export const PlateElement = (props: Props) => ( isUniqueChild={ (props.element.children as TDescendant[])?.length === 1 } - inElement={true} /> )} @@ -48,7 +45,6 @@ export const PlateElement = (props: Props) => ( isUniqueChild={ (props.element.children as TDescendant[])?.length === 1 } - inElement={true} /> )} @@ -63,7 +59,6 @@ export const PlateElement = (props: Props) => ( isUniqueChild={ (props.element.children as TDescendant[])?.length === 1 } - inElement={true} /> )} @@ -78,17 +73,13 @@ export const PlateElement = (props: Props) => ( isUniqueChild={ (props.element.children as TDescendant[])?.length === 1 } - inElement={true} /> )} - +
{(child) => ( ( isUniqueChild={ (props.element.children as TDescendant[])?.length === 1 } - inElement={true} /> )} - +
) - -type ElementRootProps = { - element: TElement - inElement: boolean - children: JSXElement -} - -const ElementRoot = (props: ElementRootProps) => { - return ( - - - {props.children} - - -
- {props.children} -
-
-
- ) -} diff --git a/packages/embeds/nextjs/package.json b/packages/embeds/nextjs/package.json index 215f6e5a9..8a11d5f4f 100644 --- a/packages/embeds/nextjs/package.json +++ b/packages/embeds/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/nextjs", - "version": "0.2.37", + "version": "0.2.38", "description": "Convenient library to display typebots on your Next.js website", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/embeds/react/package.json b/packages/embeds/react/package.json index 57f0fcfd3..d9a218e8f 100644 --- a/packages/embeds/react/package.json +++ b/packages/embeds/react/package.json @@ -1,6 +1,6 @@ { "name": "@typebot.io/react", - "version": "0.2.37", + "version": "0.2.38", "description": "Convenient library to display typebots on your React app", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/lib/markdown/remark-slate/remarkDefaultElementRules.ts b/packages/lib/markdown/remark-slate/remarkDefaultElementRules.ts index 0a6242120..86876adbb 100644 --- a/packages/lib/markdown/remark-slate/remarkDefaultElementRules.ts +++ b/packages/lib/markdown/remark-slate/remarkDefaultElementRules.ts @@ -50,7 +50,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { type: getPluginType(options.editor, headingType), children: remarkTransformElementChildren( node, - lastLineNumber, + node.position.end.line, options ), }, @@ -76,7 +76,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { indent, children: remarkTransformElementChildren( paragraph || '', - lastLineNumber, + node.position.end.line, options ), }) @@ -103,7 +103,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { ), children: remarkTransformElementChildren( node, - lastLineNumber, + node.position.end.line, options ), }, @@ -112,29 +112,31 @@ export const remarkDefaultElementRules: RemarkElementRules = { }, }, listItem: { - transform: (node, lastLineNumber, options) => ({ - type: getPluginType(options.editor, ELEMENT_LI), - children: remarkTransformElementChildren( - node, - lastLineNumber, - options - ).map( - (child) => - ({ - ...child, - type: - child.type === getPluginType(options.editor, ELEMENT_PARAGRAPH) - ? getPluginType(options.editor, ELEMENT_LIC) - : child.type, - } as TDescendant) - ), - }), + transform: (node, _lastLineNumber, options) => { + return { + type: getPluginType(options.editor, ELEMENT_LI), + children: remarkTransformElementChildren( + node, + node.position.end.line, + options + ).map( + (child) => + ({ + ...child, + type: + child.type === getPluginType(options.editor, ELEMENT_PARAGRAPH) + ? getPluginType(options.editor, ELEMENT_LIC) + : child.type, + } as TDescendant) + ), + } + }, }, paragraph: { transform: (node, lastLineNumber, options) => { const children = remarkTransformElementChildren( node, - lastLineNumber, + node.position.end.line, options ) @@ -182,7 +184,11 @@ export const remarkDefaultElementRules: RemarkElementRules = { { type: getPluginType(options.editor, ELEMENT_LINK), url: node.url, - children: remarkTransformElementChildren(node, lastLineNumber, options), + children: remarkTransformElementChildren( + node, + node.position.end.line, + options + ), }, ], }, @@ -203,7 +209,11 @@ export const remarkDefaultElementRules: RemarkElementRules = { { type: getPluginType(options.editor, ELEMENT_BLOCKQUOTE), children: node.children!.flatMap((paragraph) => - remarkTransformElementChildren(paragraph, lastLineNumber, options) + remarkTransformElementChildren( + paragraph, + node.position.end.line, + options + ) ), }, ],