Skip to content

Commit

Permalink
添加对'apaasify'语言类型的支持,并更新默认值格式
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jan 3, 2025
1 parent 4de1707 commit 60316f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
2 changes: 2 additions & 0 deletions src/MarkdownEditor/editor/elements/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const MElement = (
return <List {...props} />;
case 'schema':
return <Schema {...props} />;
case 'apaasify':
return <Schema {...props} />;
case 'code':
return <CodeElement {...props}>{props.children}</CodeElement>;
case 'code-line':
Expand Down
21 changes: 2 additions & 19 deletions src/MarkdownEditor/editor/elements/schema.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BetaSchemaForm, ProConfigProvider } from '@ant-design/pro-components';
import React, { useMemo } from 'react';
import React, { useMemo } from 'react';
import { RenderElementProps } from 'slate-react';
import { useEditorStore } from '../store';
import { EditorUtils } from '../utils';
Expand All @@ -9,7 +8,6 @@ export const Schema: React.FC<RenderElementProps> = (props) => {
const { store, readonly } = useEditorStore();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const htmlRef = React.useRef<HTMLDivElement>(null);

return useMemo(
() => (
<div
Expand Down Expand Up @@ -61,22 +59,7 @@ export const Schema: React.FC<RenderElementProps> = (props) => {
}}
data-be={node?.type}
>
<ProConfigProvider>
<BetaSchemaForm<Record<string, any>>
columns={Array.isArray(node.value) ? node.value : []}
autoFocusFirstInput={false}
submitter={{
searchConfig: {
submitText: node.otherProps?.submitText || 'Send',
},
resetButtonProps: {
style: {
display: 'none',
},
},
}}
/>
</ProConfigProvider>
{JSON.stringify(node?.value, null, 2)}
</div>
</div>
<span
Expand Down

1 comment on commit 60316f1

@vercel
Copy link

@vercel vercel bot commented on 60316f1 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.