/** * @registerModule */ import SlAlert from '@shoelace-style/shoelace/dist/components/alert/alert.js' import { escapeHtml } from './browser-utils.js'; /* */ export function notify(message, variant = 'primary', icon = 'info-circle', duration = 3000) { const alert = Object.assign(new SlAlert, { variant, closable: true, duration: duration, innerHTML: ` ${escapeHtml(message)} ` }); document.body.append(alert); return alert.toast(); }