There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
feat(mobile): mobile at menu (#8727)
L-Sun5f40fbc69c4a
diff --git a/packages/common/infra/src/modules/feature-flag/constant.ts b/packages/common/infra/src/modules/feature-flag/constant.tsindex cff05a78aa..349a7f930f 100644--- a/packages/common/infra/src/modules/feature-flag/constant.ts+++ b/packages/common/infra/src/modules/feature-flag/constant.ts@@ -162,6 +162,14 @@ export const AFFINE_FLAGS = {configurable: false,defaultState: isMobile,},+ enable_mobile_linked_doc_menu: {+ category: 'blocksuite',+ bsFlag: 'enable_mobile_linked_doc_menu',+ displayName: 'Mobile Linked Doc Widget',+ description: 'Enables the mobile linked doc menu.',+ configurable: false,+ defaultState: isMobile,+ },enable_snapshot_import_export: {category: 'affine',displayName: 'Enable Snapshot Import Export',diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/widgets/linked.ts b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/widgets/linked.tsindex dc2b36ebc3..5970c9554e 100644--- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/widgets/linked.ts+++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/specs/custom/widgets/linked.ts@@ -4,7 +4,10 @@ import { JournalService } from '@affine/core/modules/journal';import { I18n } from '@affine/i18n';import { track } from '@affine/track';import type { EditorHost } from '@blocksuite/affine/block-std';-import type { AffineInlineEditor } from '@blocksuite/affine/blocks';+import type {+ AffineInlineEditor,+ LinkedWidgetConfig,+} from '@blocksuite/affine/blocks';import { LinkedWidgetUtils } from '@blocksuite/affine/blocks';import type { DocMeta } from '@blocksuite/affine/store';import { type FrameworkProvider, WorkspaceService } from '@toeverything/infra';@@ -74,7 +77,7 @@ function createNewDocMenuGroup(// TODO: fix the typeexport function createLinkedWidgetConfig(framework: FrameworkProvider-): Partial<Record<string, unknown>> {+): Partial<LinkedWidgetConfig> {return {getMenus: (query: string,@@ -142,6 +145,17 @@ export function createLinkedWidgetConfig(),]);},+ mobile: {+ useScreenHeight: BUILD_CONFIG.isIOS,+ scrollContainer: window,+ scrollTopOffset: () => {+ const header = document.querySelector('header');+ if (!header) return 0;++ const { y, height } = header.getBoundingClientRect();+ return y + height;+ },+ },};}