react-ebookjs 0.0.3 → 0.0.5

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.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # react-ebook
2
2
 
3
+ [![NPM](https://img.shields.io/npm/v/react-ebookjs)](https://www.npmjs.com/package/react-ebookjs)
4
+
3
5
  A minimal, unstyled React component library for rendering and interacting with ebooks in web applications.
4
6
 
5
7
  ## Overview
package/dist/index.d.mts CHANGED
@@ -12,6 +12,7 @@ interface Section {
12
12
  linear?: string;
13
13
  cfi?: string;
14
14
  createDocument: () => Promise<any>;
15
+ resolveHref?: (href: string) => string | null;
15
16
  }
16
17
  type ResolveIndex = {
17
18
  index: number;
@@ -50,6 +51,7 @@ interface Book {
50
51
  resolveCFI?: (cfi: string) => ResolveIndex;
51
52
  splitTOCHref?: (href: string) => string | string[];
52
53
  getTOCFragment?: (href: string) => string;
54
+ isExternal?: (href: string) => boolean;
53
55
  }
54
56
 
55
57
  declare function loadEPUB(blob: Blob): Promise<Book>;
@@ -126,7 +128,7 @@ declare module "react" {
126
128
  namespace JSX {
127
129
  interface IntrinsicElements {
128
130
  'foliate-paginator': React.DetailedHTMLProps<React.HTMLAttributes<Paginator>, Paginator>;
129
- 'foliate-fixed-layout': React.DetailedHTMLProps<React.HTMLAttributes<FixedLayout>, FixedLayout>;
131
+ 'foliate-fxl': React.DetailedHTMLProps<React.HTMLAttributes<FixedLayout>, FixedLayout>;
130
132
  }
131
133
  }
132
134
  }
@@ -147,6 +149,7 @@ interface ReaderContentProps {
147
149
  declare function ReaderContent({ fontSize, lineSpacing, justify, hyphenate, flow }: ReaderContentProps): react_jsx_runtime.JSX.Element;
148
150
  declare function ReaderNext({ children, ...props }: Omit<React.ComponentProps<"button">, "onClick">): react_jsx_runtime.JSX.Element;
149
151
  declare function ReaderPrevious({ children, ...props }: Omit<React.ComponentProps<"button">, "onClick">): react_jsx_runtime.JSX.Element;
152
+
150
153
  declare function useBookNavigator(): {
151
154
  goTo: (target: number | string | {
152
155
  fraction: number;
@@ -154,6 +157,7 @@ declare function useBookNavigator(): {
154
157
  next: (distance?: number) => Promise<void>;
155
158
  previous: (distance?: number) => Promise<void>;
156
159
  };
160
+
157
161
  declare function useSearch(query?: string): {
158
162
  loading: boolean;
159
163
  results: {
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ interface Section {
12
12
  linear?: string;
13
13
  cfi?: string;
14
14
  createDocument: () => Promise<any>;
15
+ resolveHref?: (href: string) => string | null;
15
16
  }
16
17
  type ResolveIndex = {
17
18
  index: number;
@@ -50,6 +51,7 @@ interface Book {
50
51
  resolveCFI?: (cfi: string) => ResolveIndex;
51
52
  splitTOCHref?: (href: string) => string | string[];
52
53
  getTOCFragment?: (href: string) => string;
54
+ isExternal?: (href: string) => boolean;
53
55
  }
54
56
 
55
57
  declare function loadEPUB(blob: Blob): Promise<Book>;
@@ -126,7 +128,7 @@ declare module "react" {
126
128
  namespace JSX {
127
129
  interface IntrinsicElements {
128
130
  'foliate-paginator': React.DetailedHTMLProps<React.HTMLAttributes<Paginator>, Paginator>;
129
- 'foliate-fixed-layout': React.DetailedHTMLProps<React.HTMLAttributes<FixedLayout>, FixedLayout>;
131
+ 'foliate-fxl': React.DetailedHTMLProps<React.HTMLAttributes<FixedLayout>, FixedLayout>;
130
132
  }
131
133
  }
132
134
  }
@@ -147,6 +149,7 @@ interface ReaderContentProps {
147
149
  declare function ReaderContent({ fontSize, lineSpacing, justify, hyphenate, flow }: ReaderContentProps): react_jsx_runtime.JSX.Element;
148
150
  declare function ReaderNext({ children, ...props }: Omit<React.ComponentProps<"button">, "onClick">): react_jsx_runtime.JSX.Element;
149
151
  declare function ReaderPrevious({ children, ...props }: Omit<React.ComponentProps<"button">, "onClick">): react_jsx_runtime.JSX.Element;
152
+
150
153
  declare function useBookNavigator(): {
151
154
  goTo: (target: number | string | {
152
155
  fraction: number;
@@ -154,6 +157,7 @@ declare function useBookNavigator(): {
154
157
  next: (distance?: number) => Promise<void>;
155
158
  previous: (distance?: number) => Promise<void>;
156
159
  };
160
+
157
161
  declare function useSearch(query?: string): {
158
162
  loading: boolean;
159
163
  results: {