mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
chore(core): remove affine/cmdk package (#5552)
patch cmdk based on https://github.com/pengx17/cmdk/tree/patch-1 fix https://github.com/toeverything/AFFiNE/issues/5548
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { commandScore } from '@affine/cmdk';
|
||||
import { useCollectionManager } from '@affine/component/page-list';
|
||||
import {
|
||||
useBlockSuitePageMeta,
|
||||
@@ -19,6 +18,7 @@ import {
|
||||
type CommandCategory,
|
||||
PreconditionStrategy,
|
||||
} from '@toeverything/infra/command';
|
||||
import { commandScore } from 'cmdk';
|
||||
import { atom, useAtomValue } from 'jotai';
|
||||
import { groupBy } from 'lodash-es';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Command } from '@affine/cmdk';
|
||||
import { useCommandState } from '@affine/cmdk';
|
||||
import { formatDate } from '@affine/component/page-list';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { PageMeta } from '@blocksuite/store';
|
||||
import type { CommandCategory } from '@toeverything/infra/command';
|
||||
import clsx from 'clsx';
|
||||
import { Command, useCommandState } from 'cmdk';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import {
|
||||
Suspense,
|
||||
@@ -225,17 +224,6 @@ export const CMDKContainer = ({
|
||||
className={clsx(className, styles.panelContainer)}
|
||||
value={value}
|
||||
onValueChange={setValue}
|
||||
// Handle KeyboardEvent conflicts with blocksuite
|
||||
onKeyDown={(e: React.KeyboardEvent) => {
|
||||
if (
|
||||
e.key === 'ArrowDown' ||
|
||||
e.key === 'ArrowUp' ||
|
||||
e.key === 'ArrowLeft' ||
|
||||
e.key === 'ArrowRight'
|
||||
) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{/* todo: add page context here */}
|
||||
{isInEditor ? (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCommandState } from '@affine/cmdk';
|
||||
import { SearchIcon } from '@blocksuite/icons';
|
||||
import { useCommandState } from 'cmdk';
|
||||
import { useAtomValue } from 'jotai';
|
||||
|
||||
import { cmdkQueryAtom } from './data';
|
||||
|
||||
Reference in New Issue
Block a user