flipbookengine 0.0.1 → 0.1.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.
@@ -0,0 +1,45 @@
1
+ import b, { forwardRef as d, useRef as o, useImperativeHandle as k, useEffect as f } from "react";
2
+ import { FlipbookEngine as F } from "./flipbook-engine.js";
3
+ const R = d(({
4
+ className: p,
5
+ style: s,
6
+ pdfUrl: m,
7
+ pages: i,
8
+ onPageChange: c,
9
+ ...u
10
+ }, a) => {
11
+ const l = o(null), e = o(null);
12
+ return k(a, () => ({
13
+ get engine() {
14
+ return e.current;
15
+ },
16
+ flipNext: () => {
17
+ var r, t, n;
18
+ return (n = (t = (r = e.current) == null ? void 0 : r.ui) == null ? void 0 : t.bkNext) == null ? void 0 : n.click();
19
+ },
20
+ flipPrev: () => {
21
+ var r, t, n;
22
+ return (n = (t = (r = e.current) == null ? void 0 : r.ui) == null ? void 0 : t.bkPrev) == null ? void 0 : n.click();
23
+ },
24
+ turnToPage: (r) => {
25
+ e.current && e.current.pageFlip && e.current.pageFlip.flip(r);
26
+ }
27
+ })), f(() => {
28
+ if (!l.current) return;
29
+ const r = new F(l.current, u);
30
+ e.current = r;
31
+ const t = r.on("pageChange", (n) => c == null ? void 0 : c(n));
32
+ return r.init(m, i || []).catch(console.error), () => {
33
+ t(), r.destroy(), e.current = null;
34
+ };
35
+ }, []), f(() => {
36
+ e.current && e.current.updateOptions(u);
37
+ }, [u]), f(() => {
38
+ e.current && e.current.setPages(i || []);
39
+ }, [i]), /* @__PURE__ */ b.createElement("div", { ref: l, className: p, style: { width: "100%", height: "100%", minHeight: "400px", ...s } });
40
+ });
41
+ R.displayName = "Flipbook";
42
+ export {
43
+ R as Flipbook
44
+ };
45
+ //# sourceMappingURL=flipbook-engine.react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flipbook-engine.react.js","sources":["../src/react/index.tsx"],"sourcesContent":["/**\n * FlipbookEngine\n * Copyright (c) 2026 Murat Dogan\n * SPDX-License-Identifier: AGPL-3.0-or-later\n * https://flipbookengine.com\n */\n\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\nimport { FlipbookEngine, FlipbookEngineOptions, FlipbookPageAsset } from '../index';\n\nexport interface FlipbookProps extends Omit<FlipbookEngineOptions, 'theme'> {\n className?: string;\n style?: React.CSSProperties;\n pdfUrl: string;\n pages?: FlipbookPageAsset[];\n theme?: 'auto' | 'light' | 'dark';\n onPageChange?: (e: { currentPage: number; totalPages: number }) => void;\n}\n\nexport interface FlipbookRef {\n engine: FlipbookEngine | null;\n flipNext: () => void;\n flipPrev: () => void;\n turnToPage: (pageIndex: number) => void;\n}\n\nexport const Flipbook = forwardRef<FlipbookRef, FlipbookProps>(({\n className,\n style,\n pdfUrl,\n pages,\n onPageChange,\n ...options\n}, ref) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const engineRef = useRef<FlipbookEngine | null>(null);\n\n useImperativeHandle(ref, () => ({\n get engine() { return engineRef.current; },\n flipNext: () => (engineRef.current as any)?.ui?.bkNext?.click(),\n flipPrev: () => (engineRef.current as any)?.ui?.bkPrev?.click(),\n turnToPage: (idx: number) => {\n if (engineRef.current && (engineRef.current as any).pageFlip) {\n (engineRef.current as any).pageFlip.flip(idx);\n }\n }\n }));\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const engine = new FlipbookEngine(containerRef.current, options);\n engineRef.current = engine;\n\n const unsubscribeChange = engine.on('pageChange', (e: any) => onPageChange?.(e));\n\n engine.init(pdfUrl, pages || []).catch(console.error);\n\n return () => {\n unsubscribeChange();\n engine.destroy();\n engineRef.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []); // Run once on mount\n\n useEffect(() => {\n if (engineRef.current) {\n engineRef.current.updateOptions(options);\n }\n }, [options]);\n\n useEffect(() => {\n if (engineRef.current) {\n engineRef.current.setPages(pages || []);\n }\n }, [pages]);\n\n return <div ref={containerRef} className={className} style={{ width: '100%', height: '100%', minHeight: '400px', ...style }} />;\n});\n\nFlipbook.displayName = 'Flipbook';\n"],"names":["Flipbook","forwardRef","className","style","pdfUrl","pages","onPageChange","options","ref","containerRef","useRef","engineRef","useImperativeHandle","_c","_b","_a","idx","useEffect","engine","FlipbookEngine","unsubscribeChange","e","React"],"mappings":";;AA0BO,MAAMA,IAAWC,EAAuC,CAAC;AAAA,EAC5D,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGC;AACP,GAAGC,MAAQ;AACP,QAAMC,IAAeC,EAAuB,IAAI,GAC1CC,IAAYD,EAA8B,IAAI;AAEpD,SAAAE,EAAoBJ,GAAK,OAAO;AAAA,IAC5B,IAAI,SAAS;AAAE,aAAOG,EAAU;AAAA,IAAS;AAAA,IACzC,UAAU,MAAA;;AAAO,cAAAE,KAAAC,KAAAC,IAAAJ,EAAU,YAAV,gBAAAI,EAA2B,OAA3B,gBAAAD,EAA+B,WAA/B,gBAAAD,EAAuC;AAAA;AAAA,IACxD,UAAU,MAAA;;AAAO,cAAAA,KAAAC,KAAAC,IAAAJ,EAAU,YAAV,gBAAAI,EAA2B,OAA3B,gBAAAD,EAA+B,WAA/B,gBAAAD,EAAuC;AAAA;AAAA,IACxD,YAAY,CAACG,MAAgB;AACzB,MAAIL,EAAU,WAAYA,EAAU,QAAgB,YAC/CA,EAAU,QAAgB,SAAS,KAAKK,CAAG;AAAA,IAEpD;AAAA,EAAA,EACF,GAEFC,EAAU,MAAM;AACZ,QAAI,CAACR,EAAa,QAAS;AAE3B,UAAMS,IAAS,IAAIC,EAAeV,EAAa,SAASF,CAAO;AAC/D,IAAAI,EAAU,UAAUO;AAEpB,UAAME,IAAoBF,EAAO,GAAG,cAAc,CAACG,MAAWf,KAAA,gBAAAA,EAAee,EAAE;AAE/E,WAAAH,EAAO,KAAKd,GAAQC,KAAS,CAAA,CAAE,EAAE,MAAM,QAAQ,KAAK,GAE7C,MAAM;AACT,MAAAe,EAAA,GACAF,EAAO,QAAA,GACPP,EAAU,UAAU;AAAA,IACxB;AAAA,EAEJ,GAAG,CAAA,CAAE,GAELM,EAAU,MAAM;AACZ,IAAIN,EAAU,WACVA,EAAU,QAAQ,cAAcJ,CAAO;AAAA,EAE/C,GAAG,CAACA,CAAO,CAAC,GAEZU,EAAU,MAAM;AACZ,IAAIN,EAAU,WACVA,EAAU,QAAQ,SAASN,KAAS,CAAA,CAAE;AAAA,EAE9C,GAAG,CAACA,CAAK,CAAC,GAEH,gBAAAiB,EAAA,cAAC,OAAA,EAAI,KAAKb,GAAc,WAAAP,GAAsB,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,WAAW,SAAS,GAAGC,KAAS;AACjI,CAAC;AAEDH,EAAS,cAAc;"}
@@ -0,0 +1,54 @@
1
+ import { defineComponent as u, ref as f, onMounted as g, onBeforeUnmount as s, watch as p, h as d } from "vue";
2
+ import { FlipbookEngine as c } from "./flipbook-engine.js";
3
+ const b = u({
4
+ name: "Flipbook",
5
+ props: {
6
+ pdfUrl: {
7
+ type: String,
8
+ required: !0
9
+ },
10
+ pages: {
11
+ type: Array,
12
+ required: !1,
13
+ default: () => []
14
+ },
15
+ options: {
16
+ type: Object,
17
+ default: () => ({})
18
+ }
19
+ },
20
+ emits: ["pageChange"],
21
+ setup(i, { emit: l, expose: a }) {
22
+ const o = f(null);
23
+ let e = null, r;
24
+ return g(() => {
25
+ o.value && (e = new c(o.value, i.options), r = e.on("pageChange", (t) => l("pageChange", t)), e.init(i.pdfUrl, i.pages || []).catch(console.error));
26
+ }), s(() => {
27
+ r && r(), e && (e.destroy(), e = null);
28
+ }), p(() => i.options, (t) => {
29
+ e && e.updateOptions(t);
30
+ }, { deep: !0 }), p(() => i.pages, (t) => {
31
+ e && e.setPages(t || []);
32
+ }, { deep: !0 }), a({
33
+ getEngine: () => e,
34
+ flipNext: () => {
35
+ var t, n;
36
+ return (n = (t = e == null ? void 0 : e.ui) == null ? void 0 : t.bkNext) == null ? void 0 : n.click();
37
+ },
38
+ flipPrev: () => {
39
+ var t, n;
40
+ return (n = (t = e == null ? void 0 : e.ui) == null ? void 0 : t.bkPrev) == null ? void 0 : n.click();
41
+ },
42
+ turnToPage: (t) => {
43
+ e && e.pageFlip && e.pageFlip.flip(t);
44
+ }
45
+ }), () => d("div", {
46
+ ref: o,
47
+ style: { width: "100%", height: "100%", minHeight: "400px" }
48
+ });
49
+ }
50
+ });
51
+ export {
52
+ b as Flipbook
53
+ };
54
+ //# sourceMappingURL=flipbook-engine.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flipbook-engine.vue.js","sources":["../src/vue/index.ts"],"sourcesContent":["/**\n * FlipbookEngine\n * Copyright (c) 2026 Murat Dogan\n * SPDX-License-Identifier: AGPL-3.0-or-later\n * https://flipbookengine.com\n */\n\nimport { defineComponent, h, ref, onMounted, onBeforeUnmount, watch, PropType } from 'vue';\nimport { FlipbookEngine, FlipbookEngineOptions, FlipbookPageAsset } from '../index';\n\nexport const Flipbook = defineComponent({\n name: 'Flipbook',\n props: {\n pdfUrl: {\n type: String,\n required: true\n },\n pages: {\n type: Array as PropType<FlipbookPageAsset[]>,\n required: false,\n default: () => []\n },\n options: {\n type: Object as PropType<Omit<FlipbookEngineOptions, 'theme'> & { theme?: 'auto' | 'light' | 'dark' }>,\n default: () => ({})\n }\n },\n emits: ['pageChange'],\n setup(props, { emit, expose }) {\n const containerRef = ref<HTMLElement | null>(null);\n let engine: FlipbookEngine | null = null;\n let unsubscribeChange: () => void;\n \n onMounted(() => {\n if (!containerRef.value) return;\n \n engine = new FlipbookEngine(containerRef.value, props.options as any);\n \n unsubscribeChange = engine.on('pageChange', (e: any) => emit('pageChange', e));\n \n engine.init(props.pdfUrl, props.pages || []).catch(console.error);\n });\n \n onBeforeUnmount(() => {\n if (unsubscribeChange) unsubscribeChange();\n if (engine) {\n engine.destroy();\n engine = null;\n }\n });\n \n watch(() => props.options, (newOptions) => {\n if (engine) {\n engine.updateOptions(newOptions as any);\n }\n }, { deep: true });\n \n watch(() => props.pages, (newPages) => {\n if (engine) {\n engine.setPages(newPages || []);\n }\n }, { deep: true });\n\n expose({\n getEngine: () => engine,\n flipNext: () => (engine as any)?.ui?.bkNext?.click(),\n flipPrev: () => (engine as any)?.ui?.bkPrev?.click(),\n turnToPage: (idx: number) => {\n if (engine && (engine as any).pageFlip) {\n (engine as any).pageFlip.flip(idx);\n }\n }\n });\n\n return () => h('div', {\n ref: containerRef,\n style: { width: '100%', height: '100%', minHeight: '400px' }\n });\n }\n});\n"],"names":["Flipbook","defineComponent","props","emit","expose","containerRef","ref","engine","unsubscribeChange","onMounted","FlipbookEngine","e","onBeforeUnmount","watch","newOptions","newPages","_b","_a","idx","h"],"mappings":";;AAUO,MAAMA,IAAWC,EAAgB;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,IACH,QAAQ;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,IAEd,OAAO;AAAA,MACH,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS,MAAM,CAAA;AAAA,IAAC;AAAA,IAEpB,SAAS;AAAA,MACL,MAAM;AAAA,MACN,SAAS,OAAO,CAAA;AAAA,IAAC;AAAA,EACrB;AAAA,EAEJ,OAAO,CAAC,YAAY;AAAA,EACpB,MAAMC,GAAO,EAAE,MAAAC,GAAM,QAAAC,KAAU;AAC3B,UAAMC,IAAeC,EAAwB,IAAI;AACjD,QAAIC,IAAgC,MAChCC;AAEJ,WAAAC,EAAU,MAAM;AACZ,MAAKJ,EAAa,UAElBE,IAAS,IAAIG,EAAeL,EAAa,OAAOH,EAAM,OAAc,GAEpEM,IAAoBD,EAAO,GAAG,cAAc,CAACI,MAAWR,EAAK,cAAcQ,CAAC,CAAC,GAE7EJ,EAAO,KAAKL,EAAM,QAAQA,EAAM,SAAS,CAAA,CAAE,EAAE,MAAM,QAAQ,KAAK;AAAA,IACpE,CAAC,GAEDU,EAAgB,MAAM;AAClB,MAAIJ,KAAmBA,EAAA,GACnBD,MACAA,EAAO,QAAA,GACPA,IAAS;AAAA,IAEjB,CAAC,GAEDM,EAAM,MAAMX,EAAM,SAAS,CAACY,MAAe;AACvC,MAAIP,KACAA,EAAO,cAAcO,CAAiB;AAAA,IAE9C,GAAG,EAAE,MAAM,IAAM,GAEjBD,EAAM,MAAMX,EAAM,OAAO,CAACa,MAAa;AACnC,MAAIR,KACAA,EAAO,SAASQ,KAAY,EAAE;AAAA,IAEtC,GAAG,EAAE,MAAM,IAAM,GAEjBX,EAAO;AAAA,MACH,WAAW,MAAMG;AAAA,MACjB,UAAU,MAAA;;AAAO,gBAAAS,KAAAC,IAAAV,KAAA,gBAAAA,EAAgB,OAAhB,gBAAAU,EAAoB,WAApB,gBAAAD,EAA4B;AAAA;AAAA,MAC7C,UAAU,MAAA;;AAAO,gBAAAA,KAAAC,IAAAV,KAAA,gBAAAA,EAAgB,OAAhB,gBAAAU,EAAoB,WAApB,gBAAAD,EAA4B;AAAA;AAAA,MAC7C,YAAY,CAACE,MAAgB;AACzB,QAAIX,KAAWA,EAAe,YACzBA,EAAe,SAAS,KAAKW,CAAG;AAAA,MAEzC;AAAA,IAAA,CACH,GAEM,MAAMC,EAAE,OAAO;AAAA,MAClB,KAAKd;AAAA,MACL,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,WAAW,QAAA;AAAA,IAAQ,CAC9D;AAAA,EACL;AACJ,CAAC;"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export declare const enMessages: {
8
+ readonly emptyStateTitle: "No data available.";
9
+ readonly thumbnails: "Thumbnails";
10
+ readonly singlePageMode: "Single Page Mode";
11
+ readonly pages: "Pages";
12
+ readonly previous: "Previous";
13
+ readonly next: "Next";
14
+ readonly zoomOut: "Zoom Out";
15
+ readonly zoomIn: "Zoom In";
16
+ readonly fullscreen: "Fullscreen";
17
+ readonly settings: "Settings";
18
+ readonly downloadCatalog: "Download Catalog";
19
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export declare const trMessages: {
8
+ readonly emptyStateTitle: "Veri bulunamadi.";
9
+ readonly thumbnails: "Küçük Resimler";
10
+ readonly singlePageMode: "Tek Sayfa Modu";
11
+ readonly pages: "Sayfalar";
12
+ readonly previous: "Önceki";
13
+ readonly next: "Sonraki";
14
+ readonly zoomOut: "Uzaklaş";
15
+ readonly zoomIn: "Yaklaş";
16
+ readonly fullscreen: "Tam Ekran";
17
+ readonly settings: "Ayarlar";
18
+ readonly downloadCatalog: "Katalogu Indir";
19
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export interface FlipbookMessages {
8
+ emptyStateTitle: string;
9
+ thumbnails: string;
10
+ singlePageMode: string;
11
+ pages: string;
12
+ previous: string;
13
+ next: string;
14
+ zoomOut: string;
15
+ zoomIn: string;
16
+ fullscreen: string;
17
+ settings: string;
18
+ downloadCatalog: string;
19
+ }
20
+ export declare const builtInMessages: {
21
+ readonly en: {
22
+ readonly emptyStateTitle: "No data available.";
23
+ readonly thumbnails: "Thumbnails";
24
+ readonly singlePageMode: "Single Page Mode";
25
+ readonly pages: "Pages";
26
+ readonly previous: "Previous";
27
+ readonly next: "Next";
28
+ readonly zoomOut: "Zoom Out";
29
+ readonly zoomIn: "Zoom In";
30
+ readonly fullscreen: "Fullscreen";
31
+ readonly settings: "Settings";
32
+ readonly downloadCatalog: "Download Catalog";
33
+ };
34
+ readonly tr: {
35
+ readonly emptyStateTitle: "Veri bulunamadi.";
36
+ readonly thumbnails: "Küçük Resimler";
37
+ readonly singlePageMode: "Tek Sayfa Modu";
38
+ readonly pages: "Sayfalar";
39
+ readonly previous: "Önceki";
40
+ readonly next: "Sonraki";
41
+ readonly zoomOut: "Uzaklaş";
42
+ readonly zoomIn: "Yaklaş";
43
+ readonly fullscreen: "Tam Ekran";
44
+ readonly settings: "Ayarlar";
45
+ readonly downloadCatalog: "Katalogu Indir";
46
+ };
47
+ };
48
+ export type FlipbookLocale = keyof typeof builtInMessages;
49
+ export type PartialFlipbookMessages = Partial<FlipbookMessages>;
50
+ export interface I18nConfiguration {
51
+ locale?: FlipbookLocale | string;
52
+ messages?: Partial<Record<string, PartialFlipbookMessages>>;
53
+ }
54
+ export declare function resolveMessages(config?: I18nConfiguration): FlipbookMessages;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export { FlipbookEngine, type FlipbookEngineOptions, type PageImages, type FlipbookEngineEventMap, type FlipbookEngineEventName } from './engine';
8
+ export type { FlipbookPageAsset, FlipbookPageKind, FlipbookCropMode, FlipbookSplitDirection, NormalizedFlipbookPage } from './model/pages';
9
+ export { normalizeFlipbookPages, isFlipbookPageAsset } from './model/pages';
10
+ export type { FlipbookLocale, FlipbookMessages, PartialFlipbookMessages } from './i18n/service';
11
+ export type { FlipbookThemeMode } from './theme/theme';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export type FlipbookPageKind = 'single' | 'spread' | 'cover';
8
+ export type FlipbookCropMode = 'full' | 'left' | 'right';
9
+ export type FlipbookSplitDirection = 'ltr' | 'rtl';
10
+ export interface FlipbookPageAsset {
11
+ id?: string;
12
+ pageNumber?: number;
13
+ pageNumbers?: number[];
14
+ kind?: FlipbookPageKind;
15
+ splitDirection?: FlipbookSplitDirection;
16
+ normal: string;
17
+ low: string;
18
+ thumb: string;
19
+ }
20
+ export interface NormalizedFlipbookPage {
21
+ index: number;
22
+ assetId: string;
23
+ pageNumber: number;
24
+ cropMode: FlipbookCropMode;
25
+ normal: string;
26
+ low: string;
27
+ thumb: string;
28
+ }
29
+ export declare function isFlipbookPageAsset(value: unknown): value is FlipbookPageAsset;
30
+ export declare function normalizeFlipbookPages(assets: FlipbookPageAsset[]): NormalizedFlipbookPage[];
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { FlipbookEngine, FlipbookEngineOptions, FlipbookPageAsset } from '../index';
3
+
4
+ export interface FlipbookProps extends Omit<FlipbookEngineOptions, 'theme'> {
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ pdfUrl: string;
8
+ pages?: FlipbookPageAsset[];
9
+ theme?: 'auto' | 'light' | 'dark';
10
+ onPageChange?: (e: {
11
+ currentPage: number;
12
+ totalPages: number;
13
+ }) => void;
14
+ }
15
+ export interface FlipbookRef {
16
+ engine: FlipbookEngine | null;
17
+ flipNext: () => void;
18
+ flipPrev: () => void;
19
+ turnToPage: (pageIndex: number) => void;
20
+ }
21
+ export declare const Flipbook: React.ForwardRefExoticComponent<FlipbookProps & React.RefAttributes<FlipbookRef>>;
@@ -0,0 +1 @@
1
+ export * from './react/index'
@@ -0,0 +1,14 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export type FlipbookThemeMode = 'auto' | 'light' | 'dark';
8
+ export interface ThemeConfiguration {
9
+ theme?: FlipbookThemeMode;
10
+ primaryColor?: string;
11
+ cssVariables?: Record<string, string>;
12
+ }
13
+ export declare function ensureRuntimeStyles(): void;
14
+ export declare function applyThemeConfiguration(container: HTMLElement, config: ThemeConfiguration): void;
@@ -0,0 +1,39 @@
1
+ import { FlipbookMessages } from '../i18n/service';
2
+
3
+ export interface FlipbookUiState {
4
+ showThumbs: boolean;
5
+ }
6
+ export interface FlipbookUiOptions {
7
+ allowDownload: boolean;
8
+ hasDownloadUrl: boolean;
9
+ totalPages: number;
10
+ className?: string;
11
+ whiteLabel: boolean;
12
+ watermarkUrl?: string;
13
+ messages: FlipbookMessages;
14
+ }
15
+ export interface FlipbookUiElements {
16
+ wrapper: HTMLElement;
17
+ area: HTMLElement;
18
+ navPrev: HTMLElement;
19
+ navNext: HTMLElement;
20
+ bookWrapper: HTMLElement;
21
+ book: HTMLElement;
22
+ singleView: HTMLElement;
23
+ singleImg: HTMLImageElement;
24
+ settingsPanel: HTMLElement;
25
+ toggleThumbs: HTMLInputElement;
26
+ toggleSingle: HTMLInputElement;
27
+ btnToggleThumbs: HTMLElement;
28
+ bkPrev: HTMLElement;
29
+ bkNext: HTMLElement;
30
+ pageInfo: HTMLElement;
31
+ zoomOut: HTMLElement;
32
+ zoomIn: HTMLElement;
33
+ fullscreen: HTMLElement;
34
+ btnSettings: HTMLElement;
35
+ downloadBtn?: HTMLElement;
36
+ thumbs: HTMLElement;
37
+ }
38
+ export declare function buildFlipbookUi(state: FlipbookUiState, options: FlipbookUiOptions): FlipbookUiElements;
39
+ export declare function buildEmptyStateUi(message: string): HTMLDivElement;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * FlipbookEngine
3
+ * Copyright (c) 2026 Murat Dogan
4
+ * SPDX-License-Identifier: AGPL-3.0-or-later
5
+ * https://flipbookengine.com
6
+ */
7
+ export declare function el<K extends keyof HTMLElementTagNameMap>(tag: K, attrs?: Record<string, any> | null, children?: (string | Node | boolean | undefined | null)[] | string | Node | boolean): HTMLElementTagNameMap[K];
@@ -0,0 +1,45 @@
1
+ import { PropType } from 'vue';
2
+ import { FlipbookEngineOptions, FlipbookPageAsset } from '../index';
3
+
4
+ export declare const Flipbook: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
+ pdfUrl: {
6
+ type: StringConstructor;
7
+ required: true;
8
+ };
9
+ pages: {
10
+ type: PropType<FlipbookPageAsset[]>;
11
+ required: false;
12
+ default: () => never[];
13
+ };
14
+ options: {
15
+ type: PropType<Omit<FlipbookEngineOptions, "theme"> & {
16
+ theme?: "auto" | "light" | "dark";
17
+ }>;
18
+ default: () => {};
19
+ };
20
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
21
+ [key: string]: any;
22
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "pageChange"[], "pageChange", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
23
+ pdfUrl: {
24
+ type: StringConstructor;
25
+ required: true;
26
+ };
27
+ pages: {
28
+ type: PropType<FlipbookPageAsset[]>;
29
+ required: false;
30
+ default: () => never[];
31
+ };
32
+ options: {
33
+ type: PropType<Omit<FlipbookEngineOptions, "theme"> & {
34
+ theme?: "auto" | "light" | "dark";
35
+ }>;
36
+ default: () => {};
37
+ };
38
+ }>> & Readonly<{
39
+ onPageChange?: ((...args: any[]) => any) | undefined;
40
+ }>, {
41
+ pages: FlipbookPageAsset[];
42
+ options: Omit<FlipbookEngineOptions, "theme"> & {
43
+ theme?: "auto" | "light" | "dark";
44
+ };
45
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
package/dist/vue.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './vue/index'
package/package.json CHANGED
@@ -1,13 +1,103 @@
1
- {
2
- "name": "flipbookengine",
3
- "version": "0.0.1",
4
- "description": "This package name is reserved for an upcoming project.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "Murat Dogan",
10
- "license": "ISC",
11
- "keywords": [],
12
- "type": "commonjs"
13
- }
1
+ {
2
+ "name": "flipbookengine",
3
+ "version": "0.1.2",
4
+ "description": "A modern, embeddable HTML flipbook engine for PDF-backed catalogs and digital publications.",
5
+ "private": false,
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build && vite build --config vite.config.iife.js",
9
+ "test": "tsx --loader ./tests/css-loader.js --test tests/*.test.ts",
10
+ "typecheck": "tsc --noEmit",
11
+ "clean": "rimraf dist"
12
+ },
13
+ "keywords": [
14
+ "flipbook",
15
+ "catalog",
16
+ "pdf",
17
+ "viewer",
18
+ "publication",
19
+ "pageflip",
20
+ "digital-catalog",
21
+ "page-flip",
22
+ "typescript"
23
+ ],
24
+ "author": "Murat Dogan",
25
+ "license": "AGPL-3.0-or-later",
26
+ "homepage": "https://flipbookengine.com",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/Bizeka/flipbook-engine.git"
30
+ },
31
+ "bugs": {
32
+ "url": "https://github.com/Bizeka/flipbook-engine/issues"
33
+ },
34
+ "engines": {
35
+ "node": ">=18"
36
+ },
37
+ "sideEffects": [
38
+ "**/*.css"
39
+ ],
40
+ "files": [
41
+ "dist",
42
+ "react",
43
+ "vue",
44
+ "README.md",
45
+ "LICENSE",
46
+ "CHANGELOG.md",
47
+ "COMMERCIAL_LICENSE.md",
48
+ "TRADEMARK_POLICY.md",
49
+ "THIRD-PARTY-NOTICES.md"
50
+ ],
51
+ "main": "./dist/flipbook-engine.js",
52
+ "module": "./dist/flipbook-engine.js",
53
+ "types": "./dist/index.d.ts",
54
+ "exports": {
55
+ ".": {
56
+ "types": "./dist/index.d.ts",
57
+ "import": "./dist/flipbook-engine.js",
58
+ "default": "./dist/flipbook-engine.js"
59
+ },
60
+ "./styles.css": {
61
+ "default": "./dist/flipbook-engine.css"
62
+ },
63
+ "./react": {
64
+ "types": "./dist/react/index.d.ts",
65
+ "import": "./dist/flipbook-engine.react.js",
66
+ "default": "./dist/flipbook-engine.react.js"
67
+ },
68
+ "./vue": {
69
+ "types": "./dist/vue/index.d.ts",
70
+ "import": "./dist/flipbook-engine.vue.js",
71
+ "default": "./dist/flipbook-engine.vue.js"
72
+ }
73
+ },
74
+ "peerDependencies": {
75
+ "react": ">=16.8.0",
76
+ "vue": ">=3.0.0"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "react": {
80
+ "optional": true
81
+ },
82
+ "vue": {
83
+ "optional": true
84
+ }
85
+ },
86
+ "devDependencies": {
87
+ "@types/node": "^25.0.10",
88
+ "@types/page-flip": "^2.0.4",
89
+ "@types/react": "^19.2.14",
90
+ "react": "^19.2.6",
91
+ "rimraf": "^6.0.0",
92
+ "tsx": "^4.22.4",
93
+ "typescript": "^5.0.0",
94
+ "vite": "^5.0.0",
95
+ "vite-plugin-dts": "^3.0.0",
96
+ "vue": "^3.5.34"
97
+ },
98
+ "type": "module",
99
+ "dependencies": {
100
+ "page-flip": "^2.0.7",
101
+ "pdfjs-dist": "^5.4.530"
102
+ }
103
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/flipbook-engine.react.js",
3
+ "module": "../dist/flipbook-engine.react.js",
4
+ "types": "../dist/react/index.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/flipbook-engine.vue.js",
3
+ "module": "../dist/flipbook-engine.vue.js",
4
+ "types": "../dist/vue/index.d.ts"
5
+ }