diff --git a/demo/components/Playground.tsx b/demo/components/Playground.tsx index 402bedc44..0760981c1 100644 --- a/demo/components/Playground.tsx +++ b/demo/components/Playground.tsx @@ -86,6 +86,7 @@ export type PlaygroundProps = { disableMarkdownItAttrs?: boolean; markupParseHtmlOnPaste?: boolean; style?: React.CSSProperties; + storyAdditionalControls?: Record; } & Pick & Pick< MarkdownEditorViewProps, @@ -141,6 +142,7 @@ export const Playground = memo((props) => { disableMarkdownItAttrs, markupParseHtmlOnPaste, style, + storyAdditionalControls, } = props; const [editorMode, setEditorMode] = useState(initialEditor ?? 'wysiwyg'); const [mdRaw, setMdRaw] = useState(initial || ''); @@ -200,11 +202,20 @@ export const Playground = memo((props) => { /* webpackChunkName: "mermaid-runtime" */ '@diplodoc/mermaid-extension/runtime' ); }, + autoSave: { + enabled: storyAdditionalControls?.mermaidAutoSaveEnabled ?? true, + delay: storyAdditionalControls?.mermaidAutoSaveDelay ?? 1000, + }, }) .use(FoldingHeading) .use(YfmHtmlBlock, { useConfig: useYfmHtmlBlockStyles, sanitize: getSanitizeYfmHtmlBlock({options: defaultOptions}), + autoSave: { + enabled: + storyAdditionalControls?.yfmHtmlBlockAutoSaveEnabled ?? true, + delay: storyAdditionalControls?.yfmHtmlBlockAutoSaveDelay ?? 1000, + }, head: `