mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 10:36:22 +08:00
chore: bump version (#3449)
This commit is contained in:
@@ -52,12 +52,12 @@
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230720073515-bea92e0f-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230720073515-bea92e0f-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230720073515-bea92e0f-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230729011742-613f3782-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230729011742-613f3782-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230729011742-613f3782-nightly",
|
||||
"@blocksuite/icons": "^2.1.27",
|
||||
"@blocksuite/lit": "0.0.0-20230720073515-bea92e0f-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230720073515-bea92e0f-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230729011742-613f3782-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230729011742-613f3782-nightly",
|
||||
"@types/react": "^18.2.17",
|
||||
"@types/react-datepicker": "^4.15.0",
|
||||
"@types/react-dnd": "^3.0.2",
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
import { isBrowser } from '@affine/env/constant';
|
||||
import type { EmbedBlockDoubleClickData } from '@blocksuite/blocks';
|
||||
import { atom } from 'jotai';
|
||||
|
||||
export const previewBlockIdAtom = atom<string | null>(null);
|
||||
export const hasAnimationPlayedAtom = atom<boolean | null>(true);
|
||||
|
||||
previewBlockIdAtom.onMount = set => {
|
||||
if (isBrowser) {
|
||||
const callback = (event: CustomEvent<EmbedBlockDoubleClickData>) => {
|
||||
set(event.detail.blockId);
|
||||
};
|
||||
window.addEventListener('affine.embed-block-db-click', callback);
|
||||
return () => {
|
||||
window.removeEventListener('affine.embed-block-db-click', callback);
|
||||
};
|
||||
}
|
||||
return;
|
||||
const callback = (event: MouseEvent) => {
|
||||
const target = event.target;
|
||||
if (target instanceof HTMLImageElement) {
|
||||
const imageBlock = target.closest('affine-image');
|
||||
if (imageBlock) {
|
||||
const blockId = imageBlock.getAttribute('data-block-id');
|
||||
if (!blockId) return;
|
||||
set(blockId);
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener('dblclick', callback);
|
||||
return () => {
|
||||
window.removeEventListener('dblclick', callback);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user