fix: claviature height
+ better defaults + break out solid web component creation
This commit is contained in:
parent
4a95bf67da
commit
dfd22b5e44
3 changed files with 25 additions and 13 deletions
13
packages/widgets/solid.mjs
Normal file
13
packages/widgets/solid.mjs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue