From a0156c42a37af9248c212deda3249b6b78126958 Mon Sep 17 00:00:00 2001 From: Felix Feng Date: Sat, 28 Dec 2024 20:38:31 +0800 Subject: [PATCH] remove relative --- .../plate-ui/code-block-element-static.tsx | 11 ++++----- .../default/plate-ui/code-block-element.tsx | 2 +- .../plate-ui/column-element-static.tsx | 20 ++++++++++------ .../plate-ui/column-group-element-static.tsx | 4 ++-- .../default/plate-ui/column-group-element.tsx | 2 +- .../plate-ui/equation-element-static.tsx | 24 ++++++++++++------- .../default/plate-ui/equation-element.tsx | 6 +---- .../plate-ui/media-audio-element-static.tsx | 2 +- .../default/plate-ui/media-audio-element.tsx | 6 +---- .../default/plate-ui/media-embed-element.tsx | 6 +---- .../plate-ui/media-file-element-static.tsx | 5 +--- .../default/plate-ui/media-file-element.tsx | 2 +- .../plate-ui/media-placeholder-element.tsx | 6 +---- .../default/plate-ui/media-video-element.tsx | 6 +---- .../default/plate-ui/plate-element.tsx | 11 +++------ .../plate-ui/table-cell-element-static.tsx | 2 +- .../default/plate-ui/table-cell-element.tsx | 2 +- .../default/plate-ui/toc-element-static.tsx | 2 +- .../registry/default/plate-ui/toc-element.tsx | 6 +---- .../plate-ui/toggle-element-static.tsx | 2 +- .../default/plate-ui/toggle-element.tsx | 6 +---- .../lib/static/components/SlateElement.tsx | 5 ++++ .../plate-utils/src/react/PlateElement.tsx | 5 ++++ 23 files changed, 64 insertions(+), 79 deletions(-) diff --git a/apps/www/src/registry/default/plate-ui/code-block-element-static.tsx b/apps/www/src/registry/default/plate-ui/code-block-element-static.tsx index 70b0a36fb4..3864118e8c 100644 --- a/apps/www/src/registry/default/plate-ui/code-block-element-static.tsx +++ b/apps/www/src/registry/default/plate-ui/code-block-element-static.tsx @@ -13,15 +13,12 @@ export const CodeBlockElementStatic = ({ }: SlateElementProps) => { const { element } = props; - const codeClassName = element?.lang - ? `${element.lang} language-${element.lang}` - : ''; + const state = { + className: element?.lang ? `${element.lang} language-${element.lang}` : '', + }; return ( - +
         {children}
       
diff --git a/apps/www/src/registry/default/plate-ui/code-block-element.tsx b/apps/www/src/registry/default/plate-ui/code-block-element.tsx index 2f584ce6e7..5dee8c46b1 100644 --- a/apps/www/src/registry/default/plate-ui/code-block-element.tsx +++ b/apps/www/src/registry/default/plate-ui/code-block-element.tsx @@ -19,7 +19,7 @@ export const CodeBlockElement = withRef( return (
diff --git a/apps/www/src/registry/default/plate-ui/column-element-static.tsx b/apps/www/src/registry/default/plate-ui/column-element-static.tsx
index 8b411f54e3..73295d0710 100644
--- a/apps/www/src/registry/default/plate-ui/column-element-static.tsx
+++ b/apps/www/src/registry/default/plate-ui/column-element-static.tsx
@@ -14,12 +14,18 @@ export function ColumnElementStatic({
   const { width } = props.element as TColumnElement;
 
   return (
-    
-      {children}
-    
+    
+ +
+ {children} +
+
+
); } diff --git a/apps/www/src/registry/default/plate-ui/column-group-element-static.tsx b/apps/www/src/registry/default/plate-ui/column-group-element-static.tsx index 7c726f1794..e56f9bf513 100644 --- a/apps/www/src/registry/default/plate-ui/column-group-element-static.tsx +++ b/apps/www/src/registry/default/plate-ui/column-group-element-static.tsx @@ -11,8 +11,8 @@ export function ColumnGroupElementStatic({ ...props }: SlateElementProps) { return ( - -
{children}
+ +
{children}
); } diff --git a/apps/www/src/registry/default/plate-ui/column-group-element.tsx b/apps/www/src/registry/default/plate-ui/column-group-element.tsx index d66ef57fa6..f9eca059af 100644 --- a/apps/www/src/registry/default/plate-ui/column-group-element.tsx +++ b/apps/www/src/registry/default/plate-ui/column-group-element.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { cn, withRef } from '@udecode/cn'; +import { findNodePath } from '@udecode/plate-common'; import { useEditorRef, useElement, @@ -18,7 +19,6 @@ import { ColumnPlugin, useDebouncePopoverOpen, } from '@udecode/plate-layout/react'; -import { findNodePath } from '@udecode/plate-common'; import { type LucideProps, Trash2Icon } from 'lucide-react'; import { useReadOnly } from 'slate-react'; diff --git a/apps/www/src/registry/default/plate-ui/equation-element-static.tsx b/apps/www/src/registry/default/plate-ui/equation-element-static.tsx index ec904636dd..be10a6f5fd 100644 --- a/apps/www/src/registry/default/plate-ui/equation-element-static.tsx +++ b/apps/www/src/registry/default/plate-ui/equation-element-static.tsx @@ -5,6 +5,7 @@ import type { TEquationElement } from '@udecode/plate-math'; import { cn } from '@udecode/cn'; import { type SlateElementProps, SlateElement } from '@udecode/plate-common'; import { getEquationHtml } from '@udecode/plate-math'; +import { RadicalIcon } from 'lucide-react'; export function EquationElementStatic({ children, @@ -29,18 +30,25 @@ export function EquationElementStatic({ }); return ( - +
- + {element.texExpression.length > 0 ? ( + + ) : ( +
+ +
Add a Tex equation
+
+ )}
{children}
diff --git a/apps/www/src/registry/default/plate-ui/equation-element.tsx b/apps/www/src/registry/default/plate-ui/equation-element.tsx index e21d1f7103..d34fb61e97 100644 --- a/apps/www/src/registry/default/plate-ui/equation-element.tsx +++ b/apps/www/src/registry/default/plate-ui/equation-element.tsx @@ -39,11 +39,7 @@ export const EquationElement = withRef( }); return ( - +
+