mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
fix: replace noop function (#2744)
(cherry picked from commit af6f431c15)
This commit is contained in:
@@ -5,5 +5,5 @@ import { definePluginServerConfig } from './utils.mjs';
|
|||||||
|
|
||||||
await build({
|
await build({
|
||||||
...definePluginServerConfig('bookmark-block'),
|
...definePluginServerConfig('bookmark-block'),
|
||||||
external: ['cheerio', 'electron', 'puppeteer'],
|
external: ['cheerio', 'electron', 'puppeteer', 'foxact'],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { definePluginServerConfig } from './utils.mjs';
|
|||||||
|
|
||||||
const plugin = await context({
|
const plugin = await context({
|
||||||
...definePluginServerConfig('bookmark-block'),
|
...definePluginServerConfig('bookmark-block'),
|
||||||
external: ['cheerio', 'electron', 'puppeteer'],
|
external: ['cheerio', 'electron', 'puppeteer', 'foxact'],
|
||||||
});
|
});
|
||||||
|
|
||||||
await plugin.watch();
|
await plugin.watch();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function rpcToObservable<
|
|||||||
onSubscribe?.();
|
onSubscribe?.();
|
||||||
if (typeof window === 'undefined' || !env.isDesktop || !event) {
|
if (typeof window === 'undefined' || !env.isDesktop || !event) {
|
||||||
subscriber.complete();
|
subscriber.complete();
|
||||||
return () => {};
|
return;
|
||||||
}
|
}
|
||||||
handler?.()
|
handler?.()
|
||||||
.then(t => {
|
.then(t => {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function useMouseOffset() {
|
|||||||
el.removeEventListener('mouseleave', onMouseLeave);
|
el.removeEventListener('mouseleave', onMouseLeave);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return [offset, outside, ref] as const;
|
return [offset, outside, ref] as const;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
|
|||||||
.forEach(dispose => dispose());
|
.forEach(dispose => dispose());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
}, [editor, editor.page, page, onLoad]);
|
}, [editor, editor.page, page, onLoad]);
|
||||||
|
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ previewBlockIdAtom.onMount = set => {
|
|||||||
window.removeEventListener('affine.embed-block-db-click', callback);
|
window.removeEventListener('affine.embed-block-db-click', callback);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ function NotificationCard(props: NotificationCardProps): ReactElement {
|
|||||||
h.filter(height => height.notificationKey !== notification.key)
|
h.filter(height => height.notificationKey !== notification.key)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
}, [notification.key, setHeights]);
|
}, [notification.key, setHeights]);
|
||||||
return (
|
return (
|
||||||
<Toast.Root
|
<Toast.Root
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function useBlockSuiteWorkspaceAvatarUrl(
|
|||||||
dispose.dispose();
|
dispose.dispose();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
}, [blockSuiteWorkspace]);
|
}, [blockSuiteWorkspace]);
|
||||||
return [avatar ?? null, setAvatar] as const;
|
return [avatar ?? null, setAvatar] as const;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ rootCurrentWorkspaceIdAtom.onMount = set => {
|
|||||||
Router.events.off('routeChangeStart', callback);
|
Router.events.off('routeChangeStart', callback);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const rootCurrentPageIdAtom = atom<string | null>(null);
|
export const rootCurrentPageIdAtom = atom<string | null>(null);
|
||||||
@@ -69,7 +69,7 @@ rootCurrentPageIdAtom.onMount = set => {
|
|||||||
Router.events.off('routeChangeStart', callback);
|
Router.events.off('routeChangeStart', callback);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return () => {};
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
// current editor atom, each app should have only one editor in the same time
|
// current editor atom, each app should have only one editor in the same time
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@toeverything/plugin-infra": "workspace:*",
|
"@toeverything/plugin-infra": "workspace:*",
|
||||||
|
"foxact": "^0.2.7",
|
||||||
"link-preview-js": "^3.0.4"
|
"link-preview-js": "^3.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { PluginBlockSuiteAdapter } from '@toeverything/plugin-infra/type';
|
import type { PluginBlockSuiteAdapter } from '@toeverything/plugin-infra/type';
|
||||||
|
import { noop } from 'foxact/noop';
|
||||||
import { StrictMode } from 'react';
|
import { StrictMode } from 'react';
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ export default {
|
|||||||
div.remove();
|
div.remove();
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return () => {};
|
return noop;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
} satisfies Partial<PluginBlockSuiteAdapter>;
|
} satisfies Partial<PluginBlockSuiteAdapter>;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ __metadata:
|
|||||||
resolution: "@affine/bookmark-block@workspace:plugins/bookmark-block"
|
resolution: "@affine/bookmark-block@workspace:plugins/bookmark-block"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@toeverything/plugin-infra": "workspace:*"
|
"@toeverything/plugin-infra": "workspace:*"
|
||||||
|
foxact: ^0.2.7
|
||||||
link-preview-js: ^3.0.4
|
link-preview-js: ^3.0.4
|
||||||
react: 18.3.0-canary-16d053d59-20230506
|
react: 18.3.0-canary-16d053d59-20230506
|
||||||
react-dom: 18.3.0-canary-16d053d59-20230506
|
react-dom: 18.3.0-canary-16d053d59-20230506
|
||||||
@@ -12573,7 +12574,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"client-only@npm:0.0.1":
|
"client-only@npm:0.0.1, client-only@npm:^0.0.1":
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
resolution: "client-only@npm:0.0.1"
|
resolution: "client-only@npm:0.0.1"
|
||||||
checksum: 0c16bf660dadb90610553c1d8946a7fdfb81d624adea073b8440b7d795d5b5b08beb3c950c6a2cf16279365a3265158a236876d92bce16423c485c322d7dfaf8
|
checksum: 0c16bf660dadb90610553c1d8946a7fdfb81d624adea073b8440b7d795d5b5b08beb3c950c6a2cf16279365a3265158a236876d92bce16423c485c322d7dfaf8
|
||||||
@@ -16145,6 +16146,21 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"foxact@npm:^0.2.7":
|
||||||
|
version: 0.2.7
|
||||||
|
resolution: "foxact@npm:0.2.7"
|
||||||
|
dependencies:
|
||||||
|
client-only: ^0.0.1
|
||||||
|
server-only: ^0.0.1
|
||||||
|
peerDependencies:
|
||||||
|
react: "*"
|
||||||
|
peerDependenciesMeta:
|
||||||
|
react:
|
||||||
|
optional: true
|
||||||
|
checksum: d60a292461a80e9c23137b8cf054841e3d99366e465c6b32bf81803821bedbe7c2ce374c5264921a5eb3df7ed3c7cb4d95db40e253bc745c2eb226c38ecd116b
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"fractional-indexing@npm:^3.2.0":
|
"fractional-indexing@npm:^3.2.0":
|
||||||
version: 3.2.0
|
version: 3.2.0
|
||||||
resolution: "fractional-indexing@npm:3.2.0"
|
resolution: "fractional-indexing@npm:3.2.0"
|
||||||
@@ -24703,6 +24719,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"server-only@npm:^0.0.1":
|
||||||
|
version: 0.0.1
|
||||||
|
resolution: "server-only@npm:0.0.1"
|
||||||
|
checksum: c432348956641ea3f460af8dc3765f3a1bdbcf7a1e0205b0756d868e6e6fe8934cdee6bff68401a1dd49ba4a831c75916517a877446d54b334f7de36fa273e53
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"set-blocking@npm:^2.0.0":
|
"set-blocking@npm:^2.0.0":
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
resolution: "set-blocking@npm:2.0.0"
|
resolution: "set-blocking@npm:2.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user