mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
205cd7a86d
Closes: BS-2946
18 lines
481 B
TypeScript
18 lines
481 B
TypeScript
import type { EditorHost } from '@blocksuite/std';
|
|
|
|
export function isInsidePageEditor(host: EditorHost) {
|
|
return Array.from(host.children).some(
|
|
v => v.tagName.toLowerCase() === 'affine-page-root'
|
|
);
|
|
}
|
|
|
|
export function isInsideEdgelessEditor(host: EditorHost) {
|
|
if (!host) return false;
|
|
|
|
return Array.from(host.children).some(
|
|
v =>
|
|
v.tagName.toLowerCase() === 'affine-edgeless-root' ||
|
|
v.tagName.toLowerCase() === 'affine-edgeless-root-preview'
|
|
);
|
|
}
|