From c25de5c6cef81f9423ff0c18c8f81d5121b801c8 Mon Sep 17 00:00:00 2001 From: George Desipris <73396808+desiprisg@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:58:35 +0200 Subject: [PATCH] fix(dashboard): Remove redundant maily blocks (#7295) --- apps/dashboard/.vscode/settings.json | 5 ++- .../workflow-editor/steps/email/maily.tsx | 36 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/.vscode/settings.json b/apps/dashboard/.vscode/settings.json index d60cb6f6757..2bfcaca9495 100644 --- a/apps/dashboard/.vscode/settings.json +++ b/apps/dashboard/.vscode/settings.json @@ -3,5 +3,8 @@ "tailwindCSS.experimental.classRegex": [ ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"], ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] - ] + ], + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + } } diff --git a/apps/dashboard/src/components/workflow-editor/steps/email/maily.tsx b/apps/dashboard/src/components/workflow-editor/steps/email/maily.tsx index e4bbf5b81bc..bf320de8f08 100644 --- a/apps/dashboard/src/components/workflow-editor/steps/email/maily.tsx +++ b/apps/dashboard/src/components/workflow-editor/steps/email/maily.tsx @@ -3,6 +3,23 @@ import { useWorkflow } from '@/components/workflow-editor/workflow-provider'; import { parseStepVariablesToLiquidVariables } from '@/utils/parseStepVariablesToLiquidVariables'; import { cn } from '@/utils/ui'; import { Editor } from '@maily-to/core'; +import { + blockquote, + bulletList, + button, + columns, + divider, + forLoop, + hardBreak, + heading1, + heading2, + heading3, + image, + orderedList, + section, + spacer, + text, +} from '@maily-to/core/blocks'; import type { Editor as TiptapEditor } from '@tiptap/core'; import { HTMLAttributes, useMemo, useState } from 'react'; import { useFormContext } from 'react-hook-form'; @@ -29,9 +46,26 @@ export const Maily = (props: MailyProps) => { div]:h-full [&_.tiptap]:h-full', }} + blocks={[ + text, + heading1, + heading2, + heading3, + bulletList, + orderedList, + image, + section, + columns, + forLoop, + divider, + spacer, + button, + hardBreak, + blockquote, + ]} triggerSuggestionCharacter="{{" variables={variables.map((v) => ({ name: v.label, required: false }))} contentJson={field.value ? JSON.parse(field.value) : undefined}