flipbookengine 1.0.0 → 1.0.2
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/CHANGELOG.md +113 -94
- package/README.md +427 -421
- package/dist/components/AnnotationPlacement.d.ts +5 -0
- package/dist/components/AnnotationPopover.d.ts +10 -0
- package/dist/components/App.d.ts +9 -2
- package/dist/components/NoteEditor.d.ts +13 -0
- package/dist/components/NotePlacementLayer.d.ts +11 -0
- package/dist/components/NotesPanel.d.ts +9 -6
- package/dist/components/ReaderHelp.d.ts +3 -0
- package/dist/components/ReaderShortcuts.d.ts +16 -0
- package/dist/components/TableOfContents.d.ts +1 -0
- package/dist/components/TextLayer.d.ts +8 -0
- package/dist/components/Toolbar.d.ts +1 -1
- package/dist/components/ToolbarMore.d.ts +6 -0
- package/dist/components/Viewer.d.ts +2 -0
- package/dist/core/TextLayerLoader.d.ts +5 -0
- package/dist/core/domSignal.d.ts +2 -0
- package/dist/core-entry.d.ts +1 -0
- package/dist/engine-DD5qEHLm.js +4657 -0
- package/dist/engine-DD5qEHLm.js.map +1 -0
- package/dist/engine.d.ts +23 -0
- package/dist/flipbook-engine.core.js +1 -1
- package/dist/flipbook-engine.css +1 -1
- package/dist/flipbook-engine.iife.js +34 -47
- package/dist/flipbook-engine.iife.js.map +1 -1
- package/dist/flipbook-engine.js +1 -1
- package/dist/flipbook-engine.react.js +1 -1
- package/dist/flipbook-engine.vue.js +1 -1
- package/dist/i18n/locales/en.d.ts +22 -0
- package/dist/i18n/locales/tr.d.ts +22 -0
- package/dist/i18n/service.d.ts +66 -0
- package/dist/index.d.ts +3 -0
- package/dist/model/annotations.d.ts +1 -0
- package/dist/model/backend.d.ts +8 -0
- package/dist/model/note-editor.d.ts +22 -0
- package/dist/model/text-layer.d.ts +21 -0
- package/dist/state/store.d.ts +16 -0
- package/docs/api-reference.md +227 -205
- package/docs/backend-text-layers.md +40 -0
- package/package.json +165 -165
- package/dist/engine-Dt2Fn6O-.js +0 -4060
- package/dist/engine-Dt2Fn6O-.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlipbookAnnotation } from '../model/annotations';
|
|
2
|
+
import { FlipbookStore } from '../state/store';
|
|
3
|
+
|
|
4
|
+
export declare function AnnotationPopover(props: {
|
|
5
|
+
store: FlipbookStore;
|
|
6
|
+
signal: AbortSignal;
|
|
7
|
+
onSave: (note: FlipbookAnnotation) => Promise<boolean>;
|
|
8
|
+
onDelete: (note: FlipbookAnnotation) => Promise<boolean>;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}): import('@serenity-is/domwise').JSXElement;
|
package/dist/components/App.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FlipbookNoteDocument } from '../model/note-editor';
|
|
1
2
|
import { FlipbookSearchOptions } from '../model/search';
|
|
2
3
|
import { FlipbookHotspot } from '../model/hotspots';
|
|
3
4
|
import { FlipbookAnnotation } from '../model/annotations';
|
|
@@ -21,8 +22,13 @@ interface AppProps {
|
|
|
21
22
|
onShare: () => void;
|
|
22
23
|
onToggleBookmark: () => void;
|
|
23
24
|
onToggleNotes: () => void;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
onSelectNote: (pageIndex: number) => void;
|
|
26
|
+
onBeginAnnotation: () => void;
|
|
27
|
+
onPlaceAnnotation: (pageIndex: number, x: number, y: number) => void;
|
|
28
|
+
onSaveAnnotation: (annotation: FlipbookAnnotation) => Promise<boolean>;
|
|
29
|
+
onDeleteAnnotation: (annotation: FlipbookAnnotation) => Promise<boolean>;
|
|
30
|
+
onSaveNote: (note: string, document?: FlipbookNoteDocument) => Promise<boolean>;
|
|
31
|
+
onClearNote: () => Promise<boolean>;
|
|
26
32
|
onCloseNotes: () => void;
|
|
27
33
|
onSearch: (query: string, options?: FlipbookSearchOptions) => void;
|
|
28
34
|
onClearSearch: () => void;
|
|
@@ -35,6 +41,7 @@ interface AppProps {
|
|
|
35
41
|
onToggleFullscreen: () => void;
|
|
36
42
|
store: FlipbookStore;
|
|
37
43
|
pluginRegistry?: FlipbookPluginRegistry;
|
|
44
|
+
signal: AbortSignal;
|
|
38
45
|
}
|
|
39
46
|
export declare function App(props: AppProps): import('@serenity-is/domwise').JSXElement;
|
|
40
47
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FlipbookNoteEditor, FlipbookNoteEditorFactory, FlipbookNoteValue } from '../model/note-editor';
|
|
2
|
+
|
|
3
|
+
export declare function NoteEditor(props: {
|
|
4
|
+
value: FlipbookNoteValue;
|
|
5
|
+
factory?: FlipbookNoteEditorFactory;
|
|
6
|
+
signal: AbortSignal;
|
|
7
|
+
label: string;
|
|
8
|
+
view: {
|
|
9
|
+
current: FlipbookNoteEditor | null;
|
|
10
|
+
};
|
|
11
|
+
onReady: (ready: boolean) => void;
|
|
12
|
+
onDraft?: (value: FlipbookNoteValue) => void;
|
|
13
|
+
}): HTMLDivElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FlipbookStore } from '../state/store';
|
|
2
|
+
|
|
3
|
+
type Place = (page: number, x: number, y: number) => void;
|
|
4
|
+
export declare function NotePlacementLayer(props: {
|
|
5
|
+
store: FlipbookStore;
|
|
6
|
+
pageIndex: number;
|
|
7
|
+
onPlace: Place;
|
|
8
|
+
}): import('@serenity-is/domwise').JSXElement;
|
|
9
|
+
/** Long press tolerates small finger movement; dragging/pinching always cancels it. */
|
|
10
|
+
export declare function bindNoteGestures(element: HTMLElement, store: FlipbookStore, place: Place, signal: AbortSignal): void;
|
|
11
|
+
export {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { FlipbookStore } from '../state/store';
|
|
2
|
+
import { FlipbookAnnotation } from '../model/annotations';
|
|
3
|
+
import { FlipbookNoteDocument } from '../model/note-editor';
|
|
2
4
|
|
|
3
5
|
interface NotesPanelProps {
|
|
4
6
|
store: FlipbookStore;
|
|
5
|
-
onSave: (note: string) =>
|
|
6
|
-
onClear: () =>
|
|
7
|
+
onSave: (note: string, document?: FlipbookNoteDocument) => Promise<boolean>;
|
|
8
|
+
onClear: () => Promise<boolean>;
|
|
7
9
|
onClose: () => void;
|
|
10
|
+
onSelect: (pageIndex: number) => void;
|
|
11
|
+
onAnnotation: (annotation: FlipbookAnnotation) => void;
|
|
12
|
+
onAdd: () => void;
|
|
13
|
+
signal: AbortSignal;
|
|
8
14
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Page-level note UI. Persistence remains host-owned through the engine API and
|
|
11
|
-
* noteChange event; the panel intentionally does not know about a backend.
|
|
12
|
-
*/
|
|
15
|
+
/** The editor keeps its draft until the host confirms persistence. */
|
|
13
16
|
export declare function NotesPanel(props: NotesPanelProps): import('@serenity-is/domwise').JSXElement;
|
|
14
17
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FlipbookStore } from '../state/store';
|
|
2
|
+
import { InteractionManager } from '../core/InteractionManager';
|
|
3
|
+
import { PageFlipAdapter } from '../adapters/PageFlipAdapter';
|
|
4
|
+
|
|
5
|
+
export declare function ReaderShortcuts(root: HTMLElement, store: FlipbookStore, commands: {
|
|
6
|
+
pageFlipAdapterRef: {
|
|
7
|
+
current: PageFlipAdapter | null;
|
|
8
|
+
};
|
|
9
|
+
interactionManagerRef: {
|
|
10
|
+
current: InteractionManager | null;
|
|
11
|
+
};
|
|
12
|
+
onBeginAnnotation: () => void;
|
|
13
|
+
onToggleNotes: () => void;
|
|
14
|
+
onToggleFullscreen: () => void;
|
|
15
|
+
onAnnotationClose: () => void;
|
|
16
|
+
}, signal: AbortSignal): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlipbookStore } from '../state/store';
|
|
2
|
+
|
|
3
|
+
/** Transparent text is loaded independently of the PDF and page image resolution. */
|
|
4
|
+
export declare function TextLayer(props: {
|
|
5
|
+
store: FlipbookStore;
|
|
6
|
+
pageIndex: number;
|
|
7
|
+
signal: AbortSignal;
|
|
8
|
+
}): import('@serenity-is/domwise').JSXElement;
|
|
@@ -20,5 +20,5 @@ interface ToolbarProps {
|
|
|
20
20
|
onToggleFullscreen: () => void;
|
|
21
21
|
pluginRegistry?: FlipbookPluginRegistry;
|
|
22
22
|
}
|
|
23
|
-
export declare function Toolbar(props: ToolbarProps):
|
|
23
|
+
export declare function Toolbar(props: ToolbarProps): HTMLElement;
|
|
24
24
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReadonlySignal } from '@preact/signals-core';
|
|
2
|
+
import { FlipbookMessages } from '../i18n/service';
|
|
3
|
+
import { FlipbookStore } from '../state/store';
|
|
4
|
+
|
|
5
|
+
/** Secondary commands retain their original handlers and reactive icons. */
|
|
6
|
+
export declare function attachToolbarMore(toolbar: HTMLElement, messages: ReadonlySignal<FlipbookMessages>, store: FlipbookStore): void;
|
|
@@ -11,6 +11,8 @@ interface ViewerProps {
|
|
|
11
11
|
onHotspotClose: () => void;
|
|
12
12
|
onAnnotationActivate: (annotation: FlipbookAnnotation) => void;
|
|
13
13
|
onAnnotationClose: () => void;
|
|
14
|
+
onPlaceAnnotation: (pageIndex: number, x: number, y: number) => void;
|
|
15
|
+
signal: AbortSignal;
|
|
14
16
|
}
|
|
15
17
|
export declare function Viewer(props: ViewerProps): import('@serenity-is/domwise').JSXElement;
|
|
16
18
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FlipbookStore } from '../state/store';
|
|
2
|
+
import { FlipbookTextLayerProvider } from '../model/text-layer';
|
|
3
|
+
|
|
4
|
+
/** At most three visible/adjacent pages; stale requests cannot update a new session. */
|
|
5
|
+
export declare function loadTextLayers(store: FlipbookStore, provider: FlipbookTextLayerProvider, lifetime: AbortSignal): () => void;
|
package/dist/core-entry.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export type { FlipbookThemeMode, FlipbookBackgroundStyle, FlipbookBackgrounds }
|
|
|
11
11
|
export type { PdfPageMode, PdfPageLayout } from './core/PdfRenderer';
|
|
12
12
|
export { isA3Landscape } from './core/PdfRenderer';
|
|
13
13
|
export type { FlipbookHotspot, FlipbookHotspotKind, FlipbookHotspotMedia, FlipbookHotspotMediaType, FlipbookHotspotGalleryItem } from './model/hotspots';
|
|
14
|
+
export type { FlipbookTextRun, FlipbookTextPage, FlipbookTextLayerProvider } from './model/text-layer';
|