Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/medusa-be/medusa-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ module.exports = defineConfig({
admin: {
// backendUrl: BACKEND_URL,
vite: () => ({
build: {
minify: false,
sourcemap: false,
},
server: {
allowedHosts: MEDUSA_ADMIN_ALLOWED_HOSTS,
hmr: false,
Expand Down
32 changes: 3 additions & 29 deletions apps/medusa-be/src/admin/widgets/product-description-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import {
BlockTypeSelect,
BoldItalicUnderlineToggles,
CreateLink,
codeBlockPlugin,
codeMirrorPlugin,
DiffSourceToggleWrapper,
diffSourcePlugin,
headingsPlugin,
InsertCodeBlock,
InsertTable,
InsertThematicBreak,
ListsToggle,
linkDialogPlugin,
Expand Down Expand Up @@ -343,17 +337,6 @@ const htmlToMarkdown = (html: string) => {
const markdownToHtml = (markdown: string) =>
String(marked.parse(markdown, { async: false, gfm: true })).trim()

const productEditorCodeLanguages = {
bash: "Bash",
css: "CSS",
html: "HTML",
js: "JavaScript",
json: "JSON",
md: "Markdown",
sh: "Shell",
ts: "TypeScript",
} as const

const ProductDescriptionEditor = ({
data: product,
}: ProductDescriptionEditorProps) => {
Expand Down Expand Up @@ -439,7 +422,7 @@ const ProductDescriptionEditor = ({
() => [
toolbarPlugin({
toolbarContents: () => (
<DiffSourceToggleWrapper>
<>
<UndoRedo />
<Separator />
<BlockTypeSelect />
Expand All @@ -450,10 +433,8 @@ const ProductDescriptionEditor = ({
<ListsToggle />
<Separator />
<CreateLink />
<InsertTable />
<InsertThematicBreak />
<InsertCodeBlock />
</DiffSourceToggleWrapper>
</>
),
}),
headingsPlugin(),
Expand All @@ -463,16 +444,9 @@ const ProductDescriptionEditor = ({
linkPlugin(),
linkDialogPlugin(),
tablePlugin(),
codeBlockPlugin({ defaultCodeBlockLanguage: "html" }),
codeMirrorPlugin({ codeBlockLanguages: productEditorCodeLanguages }),
diffSourcePlugin({
diffMarkdown: htmlToMarkdown(product?.description ?? ""),
readOnlyDiff: true,
viewMode: "rich-text",
}),
markdownShortcutPlugin(),
Comment thread
BleedingDev marked this conversation as resolved.
],
[product?.description]
[]
)

if (!product?.id) {
Expand Down
Loading