@prose-reader/react-reader 1.270.0 → 1.272.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.
- package/dist/annotations/AnnotateControls.d.ts +1 -0
- package/dist/annotations/AnnotationDrawer.d.ts +1 -0
- package/dist/annotations/useReaderWithAnnotations.d.ts +3 -3
- package/dist/annotations/useSyncAnnotationsWithReader.d.ts +1 -0
- package/dist/common/FloatingMenu.d.ts +5 -0
- package/dist/common/utils.d.ts +1 -0
- package/dist/context/context.d.ts +12 -0
- package/dist/context/useReader.d.ts +3 -3
- package/dist/index.js +1058 -824
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AnnotateControls: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AnnotationDrawer: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -8,9 +8,9 @@ export declare const useReaderWithAnnotations: () => (Omit<Omit<Omit<Omit<{
|
|
|
8
8
|
parseCfi: (cfi: string) => import('@prose-reader/core').ProseParsedCfi & {
|
|
9
9
|
offset: number;
|
|
10
10
|
};
|
|
11
|
-
generateCfiForSpineItemPage: (
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
generateCfiForSpineItemPage: ({ spineItem, pageNode, }: {
|
|
12
|
+
spineItem: import('@prose-reader/shared').Manifest["spineItems"][number];
|
|
13
|
+
pageNode: NonNullable<import('@prose-reader/core').PageEntry["firstVisibleNode"]>;
|
|
14
14
|
}) => string;
|
|
15
15
|
resolveCfi: (params: Omit<Parameters<resolveCfi>[0], "spineItemsManager">) => Omit<import('@prose-reader/core').ProseParsedCfi & {
|
|
16
16
|
offset: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSyncAnnotationsWithReader: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const truncateText: (text: string, maxLength?: number) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Reader } from '@prose-reader/core';
|
|
2
|
+
import { Annotation, RuntimeAnnotation } from '@prose-reader/enhancer-annotations';
|
|
2
3
|
import { EnhancerAPI as GesturesEnhancerAPI } from '@prose-reader/enhancer-gestures';
|
|
3
4
|
import { Dispatch, SetStateAction } from 'react';
|
|
4
5
|
import { Signal } from 'reactjrx';
|
|
@@ -17,6 +18,13 @@ export type PrivateContextType = {
|
|
|
17
18
|
fontSizeMax: number;
|
|
18
19
|
_quickMenuOpen: boolean;
|
|
19
20
|
_onQuickMenuOpenChange: Dispatch<SetStateAction<boolean>>;
|
|
21
|
+
selectedHighlight: {
|
|
22
|
+
highlight?: RuntimeAnnotation;
|
|
23
|
+
selection?: {
|
|
24
|
+
selection: Selection;
|
|
25
|
+
itemIndex: number;
|
|
26
|
+
};
|
|
27
|
+
} | undefined;
|
|
20
28
|
};
|
|
21
29
|
export type PublicContextType = {
|
|
22
30
|
reader: (Reader & GesturesEnhancerAPI) | undefined;
|
|
@@ -31,6 +39,10 @@ export type PublicContextType = {
|
|
|
31
39
|
fontSizeScope?: PROSE_REACT_READER_SETTINGS_SCOPE_REFERENCE;
|
|
32
40
|
onFontSizeScopeChange?: (scope: PROSE_REACT_READER_SETTINGS_SCOPE) => void;
|
|
33
41
|
fontSizeValues?: Record<PROSE_REACT_READER_SETTINGS_SCOPE_REFERENCE, number | undefined>;
|
|
42
|
+
annotations?: Annotation[];
|
|
43
|
+
onAnnotationCreate?: (annotation: Annotation) => void;
|
|
44
|
+
onAnnotationUpdate?: (annotation: Pick<Annotation, "id" | "highlightColor" | "notes">) => void;
|
|
45
|
+
onAnnotationDelete?: (id: string) => void;
|
|
34
46
|
};
|
|
35
47
|
export type ReaderContextType = PrivateContextType & PublicContextType;
|
|
36
48
|
export declare const getDefaultValue: () => ReaderContextType;
|
|
@@ -13,9 +13,9 @@ export declare const useReader: () => (Omit<Omit<Omit<Omit<{
|
|
|
13
13
|
parseCfi: (cfi: string) => import('@prose-reader/core').ProseParsedCfi & {
|
|
14
14
|
offset: number;
|
|
15
15
|
};
|
|
16
|
-
generateCfiForSpineItemPage: (
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
generateCfiForSpineItemPage: ({ spineItem, pageNode, }: {
|
|
17
|
+
spineItem: import('@prose-reader/shared').Manifest["spineItems"][number];
|
|
18
|
+
pageNode: NonNullable<import('@prose-reader/core').PageEntry["firstVisibleNode"]>;
|
|
19
19
|
}) => string;
|
|
20
20
|
resolveCfi: (params: Omit<Parameters<resolveCfi>[0], "spineItemsManager">) => Omit<import('@prose-reader/core').ProseParsedCfi & {
|
|
21
21
|
offset: number;
|