hotfix: fix build error

This commit is contained in:
Felix Roos 2023-12-27 13:28:20 +01:00
parent edfa0c65f9
commit 9b5842b20e
2 changed files with 23 additions and 21 deletions

View file

@ -1,6 +1,6 @@
const parser = new DOMParser(); const parser = typeof DOMParser !== 'undefined' ? new DOMParser() : null;
export let html = (string) => { export let html = (string) => {
return parser.parseFromString(string, 'text/html').querySelectorAll('*'); return parser?.parseFromString(string, 'text/html').querySelectorAll('*');
}; };
let parseChunk = (chunk) => { let parseChunk = (chunk) => {
if (Array.isArray(chunk)) return chunk.flat().join(''); if (Array.isArray(chunk)) return chunk.flat().join('');

View file

@ -6,6 +6,7 @@ const getDocLabel = (doc) => doc.name || doc.longname;
let ctrlDown = false; let ctrlDown = false;
if (typeof window !== 'undefined') {
// Record Control key event to trigger or block the tooltip depending on the state // Record Control key event to trigger or block the tooltip depending on the state
window.addEventListener( window.addEventListener(
'keyup', 'keyup',
@ -26,6 +27,7 @@ window.addEventListener(
}, },
true, true,
); );
}
export const strudelTooltip = hoverTooltip( export const strudelTooltip = hoverTooltip(
(view, pos, side) => { (view, pos, side) => {