added some logs

This commit is contained in:
Nate Kelley 2025-09-10 10:10:02 -06:00
parent 59988260e9
commit 19ae8ca40d
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 9 additions and 8 deletions

View File

@ -109,8 +109,10 @@ export const ReportEditor = React.memo(
editor: TPlateEditor<Value, AnyPluginConfig>;
}) => {
if (isReady.current && !readOnly && onValueChange && !isStreaming) {
console.log('value', value);
platejsToMarkdown(editor, value as ReportElementsWithIds)
.then((markdown) => {
console.log('markdown', markdown);
onValueChange(markdown);
})
.catch((error) => {

View File

@ -7,7 +7,7 @@ const headingVariants = cva('relative mb-1', {
variant: {
h1: 'mt-8 mb-1.5 text-2xl font-semibold ',
h2: 'mt-6 mb-1.5 text-xl font-semibold ',
h3: 'mt-5 mb-1 text-lg font-semibold ',
h3: 'mt-5 mb-1.5 text-lg font-semibold ',
h4: 'mt-4 mb-1 text-base font-semibold ',
h5: 'mt-4 mb-1 text-sm font-semibold ',
h6: 'mt-4 mb-1 text-xs font-semibold ',

View File

@ -31,7 +31,7 @@ export function SlashInputElement(props: PlateElementProps<TSlashInputElement>)
<PlateElement
{...props}
as="div"
className="!absolute top-0 left-0 py-0 bg-item-select flex pr-1 pl-0 rounded -translate-y-0.5 -translate-x-0.5"
className="!absolute top-0 left-0 py-0 bg-item-select flex pr-1 pl-0 rounded translate-y-0 -translate-x-0.5"
data-slate-value={element.value}
>
<InlineCombobox

View File

@ -1,9 +1,4 @@
import {
deserializeMd,
type MdNodeParser,
parseAttributes,
serializeMd,
} from '@platejs/markdown';
import { deserializeMd, type MdNodeParser, parseAttributes, serializeMd } from '@platejs/markdown';
export const toggleSerializer: MdNodeParser<'toggle'> = {
serialize: (node, options) => {
@ -11,11 +6,15 @@ export const toggleSerializer: MdNodeParser<'toggle'> = {
throw new Error('Editor is required');
}
console.log(node);
const content = serializeMd(options.editor, {
...options,
value: node.children,
});
console.log('content', content);
return {
type: 'html',
value: `<toggle content="${content}"></toggle>`,