tiptap-notion-editor 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,7 @@
1
- import { BlockGroupItem, BlockItem } from '../../blocks/types';
1
+ import { BlockGroupItem } from '../../blocks/types';
2
2
  interface CommandListItemsProps {
3
3
  groups: BlockGroupItem[];
4
- flatCommands: BlockItem[];
5
- selectedIndex: number;
6
4
  onSelectIndex: (index: number) => void;
7
5
  }
8
- export declare const MenuListGroup: ({ groups, flatCommands, selectedIndex, onSelectIndex, }: CommandListItemsProps) => import("react").JSX.Element;
6
+ export declare const MenuListGroup: ({ groups, onSelectIndex, }: CommandListItemsProps) => import("react").JSX.Element;
9
7
  export {};
@@ -0,0 +1,24 @@
1
+ import { BlockGroupItem, BlockItem } from '../../blocks/types';
2
+ /**
3
+ * Bỏ dấu tiếng Việt và chuẩn hoá khoảng trắng.
4
+ *
5
+ * Người dùng gõ "/tieu de" hay "/Tiêu đề" đều phải ra cùng một kết quả, nên cả
6
+ * truy vấn lẫn nhãn đều đi qua đây trước khi so khớp. "đ" không tách ra dấu phụ
7
+ * khi NFD nên phải thay tay.
8
+ */
9
+ export declare const normalizeText: (value: string) => string;
10
+ /**
11
+ * Chấm điểm một lệnh theo truy vấn: càng khớp sát đầu tiêu đề càng cao, -1 là
12
+ * không khớp. Điểm dùng cho cả việc lọc lẫn việc chọn sẵn mục gần đúng nhất.
13
+ */
14
+ export declare const scoreBlockItem: (item: BlockItem, query: string) => number;
15
+ /**
16
+ * Giữ nguyên thứ tự nhóm và thứ tự lệnh trong nhóm, chỉ bỏ những lệnh không
17
+ * khớp và những nhóm rỗng sau khi lọc.
18
+ */
19
+ export declare const filterBlockGroups: (groups: BlockGroupItem[], query: string) => BlockGroupItem[];
20
+ /**
21
+ * Vị trí của lệnh gần đúng nhất trong danh sách đã làm phẳng — bằng điểm thì
22
+ * lấy lệnh đứng trước. Trả 0 khi chưa gõ gì để mục đầu tiên được chọn sẵn.
23
+ */
24
+ export declare const findBestMatchIndex: (commands: BlockItem[], query: string) => number;