function createMathCell({
visibility,
style,
id,
inputs,
params,
data,
config,
injections
}) {
if (!id) id = lib.generateId();
if (!style) style = "height: 5in";
const node = html`<div id="${id}" style="${style}" class="mathcell">`;
if (!visibility) visibility = () => Promises.tick(1);
visibility().then(() => {
if (!node.isConnected) {
throw new Error("Not connected to DOM");
}
lib.MathCell(id, inputs || [], params);
node.update = function (id) {
lib.evaluate(
id,
typeof data === "function" ? data(lib, node) : data,
typeof config === "function" ? config(lib, node) : config
);
};
node.update(id);
});
return node;
}