import { CssProps, RefProps } from 'lupine.web'; import { DemoStory } from '../../demo/demo-types'; import { IEditor } from './i-editor'; export const IEditorDemoPage = (props: { css?: CssProps }) => { let editor: IEditor | undefined; const ref: RefProps = { onLoad: async () => { const container = ref.$('.i-edit-view-box'); if (container) { editor = IEditor.getEditor(container); } }, }; const css: CssProps = { display: 'flex', flexDirection: 'column', height: '600px', padding: '16px', boxSizing: 'border-box', '.i-editor-demo-header': { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingBottom: '12px', }, '.i-editor-demo-desc': { fontSize: '12px', color: 'var(--secondary-color, #888)', marginLeft: '8px', }, '.i-edt-body': { flex: 1, border: '1px solid var(--primary-border, #444)', borderRadius: '8px', overflow: 'hidden', }, '.i-edit-view-box': { width: '100%', height: '100%', }, ...props.css, }; return (