bok-reader 0.4.6 → 0.5.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.
@@ -3,6 +3,15 @@ export interface BookHandle {
3
3
  goToPage: (page: number) => void;
4
4
  findAndJumpToHref: (href: string) => void;
5
5
  }
6
+ export type HighlightColor = "yellow" | "red" | "blue" | "purple";
7
+ export type Highlight = {
8
+ id: string;
9
+ chapterId: string;
10
+ start: number;
11
+ end: number;
12
+ color: HighlightColor;
13
+ text?: string;
14
+ };
6
15
  interface PageProps {
7
16
  content: string;
8
17
  title: string;
@@ -15,6 +24,10 @@ interface PageProps {
15
24
  containerElementRef: React.RefObject<HTMLDivElement | null>;
16
25
  onPageChange?: (page: number) => void;
17
26
  onPageCountChange?: (count: number) => void;
27
+ highlights: Highlight[];
28
+ onAddHighlight: (highlight: Highlight) => void;
29
+ onRemoveHighlight: (id: string) => void;
30
+ onUpdateHighlightColor: (id: string, color: HighlightColor) => void;
18
31
  }
19
32
  declare const Book: React.ForwardRefExoticComponent<PageProps & React.RefAttributes<BookHandle>>;
20
33
  export default Book;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { Highlight, HighlightColor } from '../Book';
3
+ interface HighlightsMenuProps {
4
+ highlights: Highlight[];
5
+ onClose: () => void;
6
+ onGoToPage: (page: number) => void;
7
+ onRemoveHighlight: (id: string) => void;
8
+ onUpdateHighlightColor: (id: string, color: HighlightColor) => void;
9
+ }
10
+ declare const HighlightsMenu: React.FC<HighlightsMenuProps>;
11
+ export default HighlightsMenu;