flipbookengine 0.1.7 → 0.2.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/dist/adapters/PageFlipAdapter.d.ts +20 -0
- package/dist/components/App.d.ts +18 -0
- package/dist/components/Thumbnails.d.ts +5 -0
- package/dist/components/Toolbar.d.ts +14 -0
- package/dist/components/Viewer.d.ts +7 -0
- package/dist/core/InteractionManager.d.ts +18 -0
- package/dist/core/LayoutManager.d.ts +19 -0
- package/dist/engine.d.ts +17 -65
- package/dist/flipbook-engine.css +1 -1
- package/dist/flipbook-engine.iife.js +139 -0
- package/dist/flipbook-engine.iife.js.map +1 -0
- package/dist/flipbook-engine.js +7571 -6516
- package/dist/flipbook-engine.js.map +1 -1
- package/dist/flipbook-engine.react.js +29 -28
- package/dist/flipbook-engine.react.js.map +1 -1
- package/dist/flipbook-engine.vue.js +18 -24
- package/dist/flipbook-engine.vue.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/tr.d.ts +3 -1
- package/dist/i18n/service.d.ts +7 -1
- package/dist/state/store.d.ts +31 -0
- package/package.json +3 -1
- package/dist/ui/template.d.ts +0 -41
- package/dist/utils/dom.d.ts +0 -7
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g, useRef as o, useImperativeHandle as b, useEffect as c } from "react";
|
|
3
|
+
import { FlipbookEngine as x } from "./flipbook-engine.js";
|
|
4
|
+
const v = g(({
|
|
5
|
+
className: f,
|
|
6
|
+
style: l,
|
|
7
|
+
pdfUrl: s,
|
|
8
|
+
pages: t,
|
|
9
|
+
onPageChange: n,
|
|
9
10
|
...u
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
}, p) => {
|
|
12
|
+
const i = o(null), e = o(null);
|
|
13
|
+
return b(p, () => ({
|
|
13
14
|
get engine() {
|
|
14
15
|
return e.current;
|
|
15
16
|
},
|
|
16
17
|
flipNext: () => {
|
|
17
|
-
var r
|
|
18
|
-
return (
|
|
18
|
+
var r;
|
|
19
|
+
return (r = e.current) == null ? void 0 : r.nextPage();
|
|
19
20
|
},
|
|
20
21
|
flipPrev: () => {
|
|
21
|
-
var r
|
|
22
|
-
return (
|
|
22
|
+
var r;
|
|
23
|
+
return (r = e.current) == null ? void 0 : r.prevPage();
|
|
23
24
|
},
|
|
24
25
|
turnToPage: (r) => {
|
|
25
|
-
e.current && e.current.
|
|
26
|
+
e.current && e.current.goToPage(r);
|
|
26
27
|
}
|
|
27
|
-
})),
|
|
28
|
-
if (!
|
|
29
|
-
const r = new
|
|
28
|
+
})), c(() => {
|
|
29
|
+
if (!i.current) return;
|
|
30
|
+
const r = new x(i.current, u);
|
|
30
31
|
e.current = r;
|
|
31
|
-
const
|
|
32
|
-
return r.init(
|
|
33
|
-
|
|
32
|
+
const m = r.on("pageChange", (d) => n == null ? void 0 : n(d));
|
|
33
|
+
return r.init(s, t || []).catch(console.error), () => {
|
|
34
|
+
m(), r.destroy(), e.current = null;
|
|
34
35
|
};
|
|
35
|
-
}, []),
|
|
36
|
+
}, []), c(() => {
|
|
36
37
|
e.current && e.current.updateOptions(u);
|
|
37
|
-
}, [u]),
|
|
38
|
-
e.current && e.current.setPages(
|
|
39
|
-
}, [
|
|
38
|
+
}, [u]), c(() => {
|
|
39
|
+
e.current && e.current.setPages(t || []);
|
|
40
|
+
}, [t]), /* @__PURE__ */ a("div", { ref: i, className: f, style: { width: "100%", height: "100%", minHeight: "400px", ...l } });
|
|
40
41
|
});
|
|
41
|
-
|
|
42
|
+
v.displayName = "Flipbook";
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
v as Flipbook
|
|
44
45
|
};
|
|
45
46
|
//# sourceMappingURL=flipbook-engine.react.js.map
|
|
@@ -1 +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: () =>
|
|
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\n/** @jsxImportSource react */\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?.nextPage(),\n flipPrev: () => engineRef.current?.prevPage(),\n turnToPage: (idx: number) => {\n if (engineRef.current) {\n engineRef.current.goToPage(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","_a","idx","useEffect","engine","FlipbookEngine","unsubscribeChange","e","jsx"],"mappings":";;;AA2BO,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;;AAAM,cAAAE,IAAAF,EAAU,YAAV,gBAAAE,EAAmB;AAAA;AAAA,IACnC,UAAU,MAAA;;AAAM,cAAAA,IAAAF,EAAU,YAAV,gBAAAE,EAAmB;AAAA;AAAA,IACnC,YAAY,CAACC,MAAgB;AACzB,MAAIH,EAAU,WACVA,EAAU,QAAQ,SAASG,CAAG;AAAA,IAEtC;AAAA,EAAA,EACF,GAEFC,EAAU,MAAM;AACZ,QAAI,CAACN,EAAa,QAAS;AAE3B,UAAMO,IAAS,IAAIC,EAAeR,EAAa,SAASF,CAAO;AAC/D,IAAAI,EAAU,UAAUK;AAEpB,UAAME,IAAoBF,EAAO,GAAG,cAAc,CAACG,MAAWb,KAAA,gBAAAA,EAAea,EAAE;AAE/E,WAAAH,EAAO,KAAKZ,GAAQC,KAAS,CAAA,CAAE,EAAE,MAAM,QAAQ,KAAK,GAE7C,MAAM;AACT,MAAAa,EAAA,GACAF,EAAO,QAAA,GACPL,EAAU,UAAU;AAAA,IACxB;AAAA,EAEJ,GAAG,CAAA,CAAE,GAELI,EAAU,MAAM;AACZ,IAAIJ,EAAU,WACVA,EAAU,QAAQ,cAAcJ,CAAO;AAAA,EAE/C,GAAG,CAACA,CAAO,CAAC,GAEZQ,EAAU,MAAM;AACZ,IAAIJ,EAAU,WACVA,EAAU,QAAQ,SAASN,KAAS,CAAA,CAAE;AAAA,EAE9C,GAAG,CAACA,CAAK,CAAC,GAEH,gBAAAe,EAAC,OAAA,EAAI,KAAKX,GAAc,WAAAP,GAAsB,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,WAAW,SAAS,GAAGC,KAAS;AACjI,CAAC;AAEDH,EAAS,cAAc;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { FlipbookEngine as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as l, ref as u, onMounted as f, onBeforeUnmount as g, watch as r, h as s } from "vue";
|
|
2
|
+
import { FlipbookEngine as d } from "./flipbook-engine.js";
|
|
3
|
+
const m = l({
|
|
4
4
|
name: "Flipbook",
|
|
5
5
|
props: {
|
|
6
6
|
pdfUrl: {
|
|
@@ -18,37 +18,31 @@ const b = u({
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
emits: ["pageChange"],
|
|
21
|
-
setup(
|
|
22
|
-
const o =
|
|
23
|
-
let e = null,
|
|
24
|
-
return
|
|
25
|
-
o.value && (e = new
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
}),
|
|
21
|
+
setup(n, { emit: a, expose: p }) {
|
|
22
|
+
const o = u(null);
|
|
23
|
+
let e = null, i;
|
|
24
|
+
return f(() => {
|
|
25
|
+
o.value && (e = new d(o.value, n.options), i = e.on("pageChange", (t) => a("pageChange", t)), e.init(n.pdfUrl, n.pages || []).catch(console.error));
|
|
26
|
+
}), g(() => {
|
|
27
|
+
i && i(), e && (e.destroy(), e = null);
|
|
28
|
+
}), r(() => n.options, (t) => {
|
|
29
29
|
e && e.updateOptions(t);
|
|
30
|
-
}, { deep: !0 }),
|
|
30
|
+
}, { deep: !0 }), r(() => n.pages, (t) => {
|
|
31
31
|
e && e.setPages(t || []);
|
|
32
|
-
}, { deep: !0 }),
|
|
32
|
+
}, { deep: !0 }), p({
|
|
33
33
|
getEngine: () => e,
|
|
34
|
-
flipNext: () =>
|
|
35
|
-
|
|
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
|
-
},
|
|
34
|
+
flipNext: () => e == null ? void 0 : e.nextPage(),
|
|
35
|
+
flipPrev: () => e == null ? void 0 : e.prevPage(),
|
|
42
36
|
turnToPage: (t) => {
|
|
43
|
-
e && e.
|
|
37
|
+
e && e.goToPage(t);
|
|
44
38
|
}
|
|
45
|
-
}), () =>
|
|
39
|
+
}), () => s("div", {
|
|
46
40
|
ref: o,
|
|
47
41
|
style: { width: "100%", height: "100%", minHeight: "400px" }
|
|
48
42
|
});
|
|
49
43
|
}
|
|
50
44
|
});
|
|
51
45
|
export {
|
|
52
|
-
|
|
46
|
+
m as Flipbook
|
|
53
47
|
};
|
|
54
48
|
//# sourceMappingURL=flipbook-engine.vue.js.map
|
|
@@ -1 +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: () =>
|
|
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?.nextPage(),\n flipPrev: () => engine?.prevPage(),\n turnToPage: (idx: number) => {\n if (engine) {\n engine.goToPage(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","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,MAAMA,KAAA,gBAAAA,EAAQ;AAAA,MACxB,UAAU,MAAMA,KAAA,gBAAAA,EAAQ;AAAA,MACxB,YAAY,CAACS,MAAgB;AACzB,QAAIT,KACAA,EAAO,SAASS,CAAG;AAAA,MAE3B;AAAA,IAAA,CACH,GAEM,MAAMC,EAAE,OAAO;AAAA,MAClB,KAAKZ;AAAA,MACL,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,WAAW,QAAA;AAAA,IAAQ,CAC9D;AAAA,EACL;AACJ,CAAC;"}
|
|
@@ -15,5 +15,7 @@ export declare const trMessages: {
|
|
|
15
15
|
readonly zoomIn: "Yaklaş";
|
|
16
16
|
readonly fullscreen: "Tam Ekran";
|
|
17
17
|
readonly settings: "Ayarlar";
|
|
18
|
-
readonly downloadCatalog: "
|
|
18
|
+
readonly downloadCatalog: "Kataloğu İndir";
|
|
19
|
+
readonly play: "Otomatik Oynat";
|
|
20
|
+
readonly pause: "Duraklat";
|
|
19
21
|
};
|
package/dist/i18n/service.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export interface FlipbookMessages {
|
|
|
16
16
|
fullscreen: string;
|
|
17
17
|
settings: string;
|
|
18
18
|
downloadCatalog: string;
|
|
19
|
+
play: string;
|
|
20
|
+
pause: string;
|
|
19
21
|
}
|
|
20
22
|
export declare const builtInMessages: {
|
|
21
23
|
readonly en: {
|
|
@@ -30,6 +32,8 @@ export declare const builtInMessages: {
|
|
|
30
32
|
readonly fullscreen: "Fullscreen";
|
|
31
33
|
readonly settings: "Settings";
|
|
32
34
|
readonly downloadCatalog: "Download Catalog";
|
|
35
|
+
readonly play: "Play";
|
|
36
|
+
readonly pause: "Pause";
|
|
33
37
|
};
|
|
34
38
|
readonly tr: {
|
|
35
39
|
readonly emptyStateTitle: "Veri bulunamadi.";
|
|
@@ -42,7 +46,9 @@ export declare const builtInMessages: {
|
|
|
42
46
|
readonly zoomIn: "Yaklaş";
|
|
43
47
|
readonly fullscreen: "Tam Ekran";
|
|
44
48
|
readonly settings: "Ayarlar";
|
|
45
|
-
readonly downloadCatalog: "
|
|
49
|
+
readonly downloadCatalog: "Kataloğu İndir";
|
|
50
|
+
readonly play: "Otomatik Oynat";
|
|
51
|
+
readonly pause: "Duraklat";
|
|
46
52
|
};
|
|
47
53
|
};
|
|
48
54
|
export type FlipbookLocale = keyof typeof builtInMessages;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FlipbookThemeMode } from '../theme/theme';
|
|
2
|
+
import { NormalizedFlipbookPage } from '../model/pages';
|
|
3
|
+
import { FlipbookEngineOptions } from '../engine';
|
|
4
|
+
|
|
5
|
+
export declare const currentPage: import('@preact/signals-core').Signal<number>;
|
|
6
|
+
export declare const totalPages: import('@preact/signals-core').Signal<number>;
|
|
7
|
+
export declare const isSingleMode: import('@preact/signals-core').Signal<boolean>;
|
|
8
|
+
export declare const showThumbs: import('@preact/signals-core').Signal<boolean>;
|
|
9
|
+
export declare const orientation: import('@preact/signals-core').Signal<"landscape" | "portrait">;
|
|
10
|
+
export declare const flipState: import('@preact/signals-core').Signal<"read" | "fold_corner" | "flipping">;
|
|
11
|
+
export declare const themeMode: import('@preact/signals-core').Signal<FlipbookThemeMode>;
|
|
12
|
+
export declare const allowDownload: import('@preact/signals-core').Signal<boolean>;
|
|
13
|
+
export declare const hasDownloadUrl: import('@preact/signals-core').Signal<boolean>;
|
|
14
|
+
export declare const primaryColor: import('@preact/signals-core').Signal<string>;
|
|
15
|
+
export declare const whiteLabel: import('@preact/signals-core').Signal<boolean>;
|
|
16
|
+
export declare const isZoomed: import('@preact/signals-core').Signal<boolean>;
|
|
17
|
+
export declare const isAutoPlaying: import('@preact/signals-core').Signal<boolean>;
|
|
18
|
+
export declare const autoPlayInterval: import('@preact/signals-core').Signal<number>;
|
|
19
|
+
export declare const soundEnabled: import('@preact/signals-core').Signal<boolean>;
|
|
20
|
+
export declare const zoomState: import('@preact/signals-core').Signal<{
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
translateX: number;
|
|
23
|
+
translateY: number;
|
|
24
|
+
isDragging: boolean;
|
|
25
|
+
scale: number;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const pages: import('@preact/signals-core').Signal<NormalizedFlipbookPage[]>;
|
|
28
|
+
export declare const isDoublePageLayout: import('@preact/signals-core').ReadonlySignal<boolean>;
|
|
29
|
+
export declare const isFrontCover: import('@preact/signals-core').ReadonlySignal<boolean>;
|
|
30
|
+
export declare const isBackCover: import('@preact/signals-core').ReadonlySignal<boolean>;
|
|
31
|
+
export declare function initStore(options: FlipbookEngineOptions, total: number, mappedPages: NormalizedFlipbookPage[], hasPdfUrl: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flipbookengine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A modern, embeddable HTML flipbook engine for PDF-backed catalogs and digital publications.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
@@ -97,6 +97,8 @@
|
|
|
97
97
|
},
|
|
98
98
|
"type": "module",
|
|
99
99
|
"dependencies": {
|
|
100
|
+
"@preact/signals-core": "^1.14.3",
|
|
101
|
+
"@serenity-is/domwise": "^10.2.3",
|
|
100
102
|
"page-flip": "^2.0.7",
|
|
101
103
|
"pdfjs-dist": "^5.4.530"
|
|
102
104
|
}
|
package/dist/ui/template.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
bookSizer: HTMLElement;
|
|
22
|
-
book: HTMLElement;
|
|
23
|
-
singleView: HTMLElement;
|
|
24
|
-
singleImg: HTMLImageElement;
|
|
25
|
-
settingsPanel: HTMLElement;
|
|
26
|
-
toggleThumbs: HTMLInputElement;
|
|
27
|
-
toggleSingle: HTMLInputElement;
|
|
28
|
-
btnToggleThumbs: HTMLElement;
|
|
29
|
-
bkPrev: HTMLElement;
|
|
30
|
-
bkNext: HTMLElement;
|
|
31
|
-
pageInfo: HTMLElement;
|
|
32
|
-
zoomOut: HTMLElement;
|
|
33
|
-
zoomIn: HTMLElement;
|
|
34
|
-
fullscreen: HTMLElement;
|
|
35
|
-
btnSound: HTMLElement;
|
|
36
|
-
btnSettings: HTMLElement;
|
|
37
|
-
downloadBtn?: HTMLElement;
|
|
38
|
-
thumbs: HTMLElement;
|
|
39
|
-
}
|
|
40
|
-
export declare function buildFlipbookUi(state: FlipbookUiState, options: FlipbookUiOptions): FlipbookUiElements;
|
|
41
|
-
export declare function buildEmptyStateUi(message: string): HTMLDivElement;
|
package/dist/utils/dom.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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];
|