@blocksuite/virgo
Advanced tools
Comparing version 0.4.1-20230224181613-0101128 to 0.4.1-20230225180029-daf8dec
{ | ||
"name": "@blocksuite/virgo", | ||
"version": "0.4.1-20230224181613-0101128", | ||
"version": "0.4.1-20230225180029-daf8dec", | ||
"description": "A micro editor.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.ts", |
@@ -775,7 +775,7 @@ import { assertExists, Signal } from '@blocksuite/global/utils'; | ||
const textNode = Array.from(spanElement.childNodes).find( | ||
node => node instanceof Text | ||
(node): node is Text => node instanceof Text | ||
); | ||
if (textNode) { | ||
return textNode as Text; | ||
return textNode; | ||
} | ||
@@ -858,22 +858,19 @@ return null; | ||
// every chunk is a line | ||
const lines: VirgoLine[] = []; | ||
for (const chunk of chunks) { | ||
const lines = chunks.map(chunk => { | ||
const virgoLine = new VirgoLine(); | ||
if (chunk.length === 0) { | ||
const virgoLine = new VirgoLine(); | ||
virgoLine.elements.push(new BaseText()); | ||
lines.push(virgoLine); | ||
} else { | ||
const virgoLine = new VirgoLine(); | ||
for (const delta of chunk) { | ||
chunk.forEach(delta => { | ||
const element = render(delta); | ||
virgoLine.elements.push(element); | ||
} | ||
lines.push(virgoLine); | ||
}); | ||
} | ||
} | ||
return virgoLine; | ||
}); | ||
rootElement.replaceChildren(...lines); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52755
1753