donteatfriedrice
2024-04-15 03:06:37 +00:00
parent bb1294f425
commit 7b35722288
20 changed files with 139 additions and 136 deletions
@@ -155,7 +155,7 @@ export const useSnapshotPage = (
page = historyShellWorkspace.createDoc({
id: pageId,
});
page.awarenessStore.setReadonly(page, true);
page.awarenessStore.setReadonly(page.blockCollection, true);
const spaceDoc = page.spaceDoc;
page.load(() => {
applyUpdate(spaceDoc, new Uint8Array(snapshot));
@@ -186,7 +186,6 @@ export function setupAIProvider() {
return textToText({
...options,
promptName: 'Make it real',
// @ts-expect-error todo: fix this after blocksuite bump
params: options.params,
content:
options.content ||
@@ -100,7 +100,7 @@ const ImagePreviewModalImpl = (
const block = page.getBlockById(blockId);
assertExists(block);
const nextBlock = page
.getNextSiblings(block)
.getNexts(block)
.find(
(block): block is ImageBlockModel => block.flavour === 'affine:image'
);
@@ -120,7 +120,7 @@ const ImagePreviewModalImpl = (
const block = page.getBlockById(blockId);
assertExists(block);
const prevBlock = page
.getPreviousSiblings(block)
.getPrevs(block)
.findLast(
(block): block is ImageBlockModel => block.flavour === 'affine:image'
);
@@ -142,14 +142,14 @@ const ImagePreviewModalImpl = (
assertExists(block);
if (
page
.getPreviousSiblings(block)
.getPrevs(block)
.some(
(block): block is ImageBlockModel =>
block.flavour === 'affine:image'
)
) {
const prevBlock = page
.getPreviousSiblings(block)
.getPrevs(block)
.findLast(
(block): block is ImageBlockModel =>
block.flavour === 'affine:image'
@@ -159,14 +159,14 @@ const ImagePreviewModalImpl = (
}
} else if (
page
.getNextSiblings(block)
.getNexts(block)
.some(
(block): block is ImageBlockModel =>
block.flavour === 'affine:image'
)
) {
const nextBlock = page
.getNextSiblings(block)
.getNexts(block)
.find(
(block): block is ImageBlockModel =>
block.flavour === 'affine:image'
@@ -516,7 +516,7 @@ export const ImagePreviewModal = (
if (event.key === 'ArrowLeft') {
const prevBlock = page
.getPreviousSiblings(block)
.getPrevs(block)
.findLast(
(block): block is ImageBlockModel =>
block.flavour === 'affine:image'
@@ -526,7 +526,7 @@ export const ImagePreviewModal = (
}
} else if (event.key === 'ArrowRight') {
const nextBlock = page
.getNextSiblings(block)
.getNexts(block)
.find(
(block): block is ImageBlockModel =>
block.flavour === 'affine:image'