mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 09:30:01 +08:00
Merge branch 'canary' into stable
This commit is contained in:
@@ -9,7 +9,7 @@ previewBlockIdAtom.onMount = set => {
|
||||
if (target?.tagName === 'IMG') {
|
||||
const imageBlock = target.closest('affine-image');
|
||||
if (imageBlock) {
|
||||
const blockId = imageBlock.getAttribute('data-block-id');
|
||||
const blockId = imageBlock.dataset.blockId;
|
||||
if (!blockId) return;
|
||||
set(blockId);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ const ImagePreviewModalImpl = (
|
||||
if (
|
||||
page
|
||||
.getPreviousSiblings(block)
|
||||
.findLast(
|
||||
.some(
|
||||
(block): block is ImageBlockModel =>
|
||||
block.flavour === 'affine:image'
|
||||
)
|
||||
@@ -160,7 +160,7 @@ const ImagePreviewModalImpl = (
|
||||
} else if (
|
||||
page
|
||||
.getNextSiblings(block)
|
||||
.find(
|
||||
.some(
|
||||
(block): block is ImageBlockModel =>
|
||||
block.flavour === 'affine:image'
|
||||
)
|
||||
@@ -231,9 +231,9 @@ const ImagePreviewModalImpl = (
|
||||
const a = document.createElement('a');
|
||||
a.href = downloadUrl;
|
||||
a.download = block.id ?? 'image';
|
||||
document.body.appendChild(a);
|
||||
document.body.append(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
a.remove();
|
||||
}
|
||||
},
|
||||
[props.pageId, props.workspace]
|
||||
|
||||
@@ -40,7 +40,7 @@ const Outline = () => {
|
||||
ref={useCallback((container: HTMLDivElement | null) => {
|
||||
if (container) {
|
||||
assertExists(tocPanelRef.current);
|
||||
container.appendChild(tocPanelRef.current);
|
||||
container.append(tocPanelRef.current);
|
||||
}
|
||||
}, [])}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user