flipbookengine 0.1.6 → 0.2.1
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.js +7570 -6516
- package/dist/flipbook-engine.js.map +1 -1
- package/dist/flipbook-engine.react.js +307 -32
- 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,320 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FlipbookEngine as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import ee, { forwardRef as re, useRef as D, useImperativeHandle as te, useEffect as S } from "react";
|
|
2
|
+
import { FlipbookEngine as ne } from "./flipbook-engine.js";
|
|
3
|
+
var x = { exports: {} }, b = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var L;
|
|
14
|
+
function ae() {
|
|
15
|
+
if (L) return b;
|
|
16
|
+
L = 1;
|
|
17
|
+
var c = Symbol.for("react.transitional.element"), E = Symbol.for("react.fragment");
|
|
18
|
+
function d(i, o, u) {
|
|
19
|
+
var m = null;
|
|
20
|
+
if (u !== void 0 && (m = "" + u), o.key !== void 0 && (m = "" + o.key), "key" in o) {
|
|
21
|
+
u = {};
|
|
22
|
+
for (var f in o)
|
|
23
|
+
f !== "key" && (u[f] = o[f]);
|
|
24
|
+
} else u = o;
|
|
25
|
+
return o = u.ref, {
|
|
26
|
+
$$typeof: c,
|
|
27
|
+
type: i,
|
|
28
|
+
key: m,
|
|
29
|
+
ref: o !== void 0 ? o : null,
|
|
30
|
+
props: u
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return b.Fragment = E, b.jsx = d, b.jsxs = d, b;
|
|
34
|
+
}
|
|
35
|
+
var p = {};
|
|
36
|
+
/**
|
|
37
|
+
* @license React
|
|
38
|
+
* react-jsx-runtime.development.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
var M;
|
|
46
|
+
function oe() {
|
|
47
|
+
return M || (M = 1, process.env.NODE_ENV !== "production" && function() {
|
|
48
|
+
function c(e) {
|
|
49
|
+
if (e == null) return null;
|
|
50
|
+
if (typeof e == "function")
|
|
51
|
+
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
52
|
+
if (typeof e == "string") return e;
|
|
53
|
+
switch (e) {
|
|
54
|
+
case O:
|
|
55
|
+
return "Fragment";
|
|
56
|
+
case V:
|
|
57
|
+
return "Profiler";
|
|
58
|
+
case U:
|
|
59
|
+
return "StrictMode";
|
|
60
|
+
case J:
|
|
61
|
+
return "Suspense";
|
|
62
|
+
case X:
|
|
63
|
+
return "SuspenseList";
|
|
64
|
+
case B:
|
|
65
|
+
return "Activity";
|
|
66
|
+
}
|
|
67
|
+
if (typeof e == "object")
|
|
68
|
+
switch (typeof e.tag == "number" && console.error(
|
|
69
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
|
+
), e.$$typeof) {
|
|
71
|
+
case W:
|
|
72
|
+
return "Portal";
|
|
73
|
+
case q:
|
|
74
|
+
return e.displayName || "Context";
|
|
75
|
+
case z:
|
|
76
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
+
case G:
|
|
78
|
+
var r = e.render;
|
|
79
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
+
case H:
|
|
81
|
+
return r = e.displayName || null, r !== null ? r : c(e.type) || "Memo";
|
|
82
|
+
case A:
|
|
83
|
+
r = e._payload, e = e._init;
|
|
84
|
+
try {
|
|
85
|
+
return c(e(r));
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
function E(e) {
|
|
92
|
+
return "" + e;
|
|
93
|
+
}
|
|
94
|
+
function d(e) {
|
|
95
|
+
try {
|
|
96
|
+
E(e);
|
|
97
|
+
var r = !1;
|
|
98
|
+
} catch {
|
|
99
|
+
r = !0;
|
|
100
|
+
}
|
|
101
|
+
if (r) {
|
|
102
|
+
r = console;
|
|
103
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
104
|
+
return t.call(
|
|
105
|
+
r,
|
|
106
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
+
n
|
|
108
|
+
), E(e);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function i(e) {
|
|
112
|
+
if (e === O) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === A)
|
|
114
|
+
return "<...>";
|
|
115
|
+
try {
|
|
116
|
+
var r = c(e);
|
|
117
|
+
return r ? "<" + r + ">" : "<...>";
|
|
118
|
+
} catch {
|
|
119
|
+
return "<...>";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function o() {
|
|
123
|
+
var e = P.A;
|
|
124
|
+
return e === null ? null : e.getOwner();
|
|
125
|
+
}
|
|
126
|
+
function u() {
|
|
127
|
+
return Error("react-stack-top-frame");
|
|
128
|
+
}
|
|
129
|
+
function m(e) {
|
|
130
|
+
if (N.call(e, "key")) {
|
|
131
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
|
+
if (r && r.isReactWarning) return !1;
|
|
133
|
+
}
|
|
134
|
+
return e.key !== void 0;
|
|
135
|
+
}
|
|
136
|
+
function f(e, r) {
|
|
137
|
+
function t() {
|
|
138
|
+
C || (C = !0, console.error(
|
|
139
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
+
r
|
|
141
|
+
));
|
|
142
|
+
}
|
|
143
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
+
get: t,
|
|
145
|
+
configurable: !0
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function l() {
|
|
149
|
+
var e = c(this.type);
|
|
150
|
+
return Y[e] || (Y[e] = !0, console.error(
|
|
151
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
|
+
}
|
|
154
|
+
function s(e, r, t, n, k, w) {
|
|
155
|
+
var a = t.ref;
|
|
156
|
+
return e = {
|
|
157
|
+
$$typeof: h,
|
|
158
|
+
type: e,
|
|
159
|
+
key: r,
|
|
160
|
+
props: t,
|
|
161
|
+
_owner: n
|
|
162
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
get: l
|
|
165
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
|
+
configurable: !1,
|
|
167
|
+
enumerable: !1,
|
|
168
|
+
writable: !0,
|
|
169
|
+
value: 0
|
|
170
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
171
|
+
configurable: !1,
|
|
172
|
+
enumerable: !1,
|
|
173
|
+
writable: !0,
|
|
174
|
+
value: null
|
|
175
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
176
|
+
configurable: !1,
|
|
177
|
+
enumerable: !1,
|
|
178
|
+
writable: !0,
|
|
179
|
+
value: k
|
|
180
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
181
|
+
configurable: !1,
|
|
182
|
+
enumerable: !1,
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: w
|
|
185
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
186
|
+
}
|
|
187
|
+
function R(e, r, t, n, k, w) {
|
|
188
|
+
var a = r.children;
|
|
189
|
+
if (a !== void 0)
|
|
190
|
+
if (n)
|
|
191
|
+
if (Q(a)) {
|
|
192
|
+
for (n = 0; n < a.length; n++)
|
|
193
|
+
v(a[n]);
|
|
194
|
+
Object.freeze && Object.freeze(a);
|
|
195
|
+
} else
|
|
196
|
+
console.error(
|
|
197
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
|
+
);
|
|
199
|
+
else v(a);
|
|
200
|
+
if (N.call(r, "key")) {
|
|
201
|
+
a = c(e);
|
|
202
|
+
var _ = Object.keys(r).filter(function(K) {
|
|
203
|
+
return K !== "key";
|
|
204
|
+
});
|
|
205
|
+
n = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
207
|
+
let props = %s;
|
|
208
|
+
<%s {...props} />
|
|
209
|
+
React keys must be passed directly to JSX without using spread:
|
|
210
|
+
let props = %s;
|
|
211
|
+
<%s key={someKey} {...props} />`,
|
|
212
|
+
n,
|
|
213
|
+
a,
|
|
214
|
+
_,
|
|
215
|
+
a
|
|
216
|
+
), I[a + n] = !0);
|
|
217
|
+
}
|
|
218
|
+
if (a = null, t !== void 0 && (d(t), a = "" + t), m(r) && (d(r.key), a = "" + r.key), "key" in r) {
|
|
219
|
+
t = {};
|
|
220
|
+
for (var y in r)
|
|
221
|
+
y !== "key" && (t[y] = r[y]);
|
|
222
|
+
} else t = r;
|
|
223
|
+
return a && f(
|
|
224
|
+
t,
|
|
225
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
226
|
+
), s(
|
|
227
|
+
e,
|
|
228
|
+
a,
|
|
229
|
+
t,
|
|
230
|
+
o(),
|
|
231
|
+
k,
|
|
232
|
+
w
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function v(e) {
|
|
236
|
+
j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
237
|
+
}
|
|
238
|
+
function j(e) {
|
|
239
|
+
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
240
|
+
}
|
|
241
|
+
var T = ee, h = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), q = Symbol.for("react.context"), G = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), H = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), P = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, Q = Array.isArray, g = console.createTask ? console.createTask : function() {
|
|
242
|
+
return null;
|
|
243
|
+
};
|
|
244
|
+
T = {
|
|
245
|
+
react_stack_bottom_frame: function(e) {
|
|
246
|
+
return e();
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
var C, Y = {}, F = T.react_stack_bottom_frame.bind(
|
|
250
|
+
T,
|
|
251
|
+
u
|
|
252
|
+
)(), $ = g(i(u)), I = {};
|
|
253
|
+
p.Fragment = O, p.jsx = function(e, r, t) {
|
|
254
|
+
var n = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return R(
|
|
256
|
+
e,
|
|
257
|
+
r,
|
|
258
|
+
t,
|
|
259
|
+
!1,
|
|
260
|
+
n ? Error("react-stack-top-frame") : F,
|
|
261
|
+
n ? g(i(e)) : $
|
|
262
|
+
);
|
|
263
|
+
}, p.jsxs = function(e, r, t) {
|
|
264
|
+
var n = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return R(
|
|
266
|
+
e,
|
|
267
|
+
r,
|
|
268
|
+
t,
|
|
269
|
+
!0,
|
|
270
|
+
n ? Error("react-stack-top-frame") : F,
|
|
271
|
+
n ? g(i(e)) : $
|
|
272
|
+
);
|
|
273
|
+
};
|
|
274
|
+
}()), p;
|
|
275
|
+
}
|
|
276
|
+
process.env.NODE_ENV === "production" ? x.exports = ae() : x.exports = oe();
|
|
277
|
+
var ue = x.exports;
|
|
278
|
+
const se = re(({
|
|
279
|
+
className: c,
|
|
280
|
+
style: E,
|
|
281
|
+
pdfUrl: d,
|
|
7
282
|
pages: i,
|
|
8
|
-
onPageChange:
|
|
283
|
+
onPageChange: o,
|
|
9
284
|
...u
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
return
|
|
285
|
+
}, m) => {
|
|
286
|
+
const f = D(null), l = D(null);
|
|
287
|
+
return te(m, () => ({
|
|
13
288
|
get engine() {
|
|
14
|
-
return
|
|
289
|
+
return l.current;
|
|
15
290
|
},
|
|
16
291
|
flipNext: () => {
|
|
17
|
-
var
|
|
18
|
-
return (
|
|
292
|
+
var s;
|
|
293
|
+
return (s = l.current) == null ? void 0 : s.nextPage();
|
|
19
294
|
},
|
|
20
295
|
flipPrev: () => {
|
|
21
|
-
var
|
|
22
|
-
return (
|
|
296
|
+
var s;
|
|
297
|
+
return (s = l.current) == null ? void 0 : s.prevPage();
|
|
23
298
|
},
|
|
24
|
-
turnToPage: (
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
})),
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
|
|
299
|
+
turnToPage: (s) => {
|
|
300
|
+
l.current && l.current.goToPage(s);
|
|
301
|
+
}
|
|
302
|
+
})), S(() => {
|
|
303
|
+
if (!f.current) return;
|
|
304
|
+
const s = new ne(f.current, u);
|
|
305
|
+
l.current = s;
|
|
306
|
+
const R = s.on("pageChange", (v) => o == null ? void 0 : o(v));
|
|
307
|
+
return s.init(d, i || []).catch(console.error), () => {
|
|
308
|
+
R(), s.destroy(), l.current = null;
|
|
34
309
|
};
|
|
35
|
-
}, []),
|
|
36
|
-
|
|
37
|
-
}, [u]),
|
|
38
|
-
|
|
39
|
-
}, [i]), /* @__PURE__ */
|
|
310
|
+
}, []), S(() => {
|
|
311
|
+
l.current && l.current.updateOptions(u);
|
|
312
|
+
}, [u]), S(() => {
|
|
313
|
+
l.current && l.current.setPages(i || []);
|
|
314
|
+
}, [i]), /* @__PURE__ */ ue.jsx("div", { ref: f, className: c, style: { width: "100%", height: "100%", minHeight: "400px", ...E } });
|
|
40
315
|
});
|
|
41
|
-
|
|
316
|
+
se.displayName = "Flipbook";
|
|
42
317
|
export {
|
|
43
|
-
|
|
318
|
+
se as Flipbook
|
|
44
319
|
};
|
|
45
320
|
//# 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: () => (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;"}
|
|
1
|
+
{"version":3,"file":"flipbook-engine.react.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/react/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\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":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","Flipbook","forwardRef","className","style","pdfUrl","pages","onPageChange","options","ref","containerRef","useRef","engineRef","useImperativeHandle","_a","idx","useEffect","engine","FlipbookEngine","unsubscribeChange","e","jsx"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAIA,IAAqB,OAAO,IAAI,4BAA4B,GAC9DC,IAAsB,OAAO,IAAI,gBAAgB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F,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,GAEHe,gBAAAA,GAAAA,IAAC,OAAA,EAAI,KAAKX,GAAc,WAAAP,GAAsB,OAAO,EAAE,OAAO,QAAQ,QAAQ,QAAQ,WAAW,SAAS,GAAGC,KAAS;AACjI,CAAC;AAEDH,GAAS,cAAc;","x_google_ignoreList":[0,1,2]}
|
|
@@ -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.1
|
|
3
|
+
"version": "0.2.1",
|
|
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;
|