Felix Roos dfd22b5e44 fix: claviature height
+ better defaults
+ break out solid web component creation
2024-03-15 11:04:35 +01:00

14 lines
351 B
JavaScript

import { setWidget } from '@strudel/codemirror';
export function getSolidWidget(type, id, options) {
let el = document.getElementById(id);
if (!el) {
el = document.createElement('div');
const c = document.createElement(type);
el.appendChild(c);
}
el.height = options.height || 200;
setWidget(id, el);
return el?.firstChild;
}