mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
14 lines
351 B
JavaScript
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;
|
|
}
|