@peeekpage/viewer 0.4.8 → 0.4.9
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/index.js +91 -91
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -137,8 +137,8 @@ function mt(t) {
|
|
|
137
137
|
const i = [];
|
|
138
138
|
for (const g of e.pages) {
|
|
139
139
|
if (g === null || typeof g != "object") continue;
|
|
140
|
-
const
|
|
141
|
-
|
|
140
|
+
const u = G(g.url);
|
|
141
|
+
u && i.push(u);
|
|
142
142
|
}
|
|
143
143
|
if (i.length === 0)
|
|
144
144
|
return { ok: !1, error: "manifest has no usable pages" };
|
|
@@ -177,7 +177,7 @@ function pt(t, e) {
|
|
|
177
177
|
function bt(t, e) {
|
|
178
178
|
const [n, a] = v("loading"), [i, d] = v(null), [h, k] = v(null), g = E(null);
|
|
179
179
|
return C(() => {
|
|
180
|
-
let
|
|
180
|
+
let u = !1;
|
|
181
181
|
if (a("loading"), d(null), k(null), !t) return;
|
|
182
182
|
const w = () => {
|
|
183
183
|
g.current !== null && (clearTimeout(g.current), g.current = null);
|
|
@@ -188,20 +188,20 @@ function bt(t, e) {
|
|
|
188
188
|
if (!l.ok) throw new Error(`HTTP ${l.status}`);
|
|
189
189
|
f = await l.json();
|
|
190
190
|
} catch (l) {
|
|
191
|
-
if (
|
|
191
|
+
if (u) return;
|
|
192
192
|
k(l instanceof Error ? l.message : "fetch failed"), a("error");
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
k(
|
|
195
|
+
if (u) return;
|
|
196
|
+
const s = mt(f);
|
|
197
|
+
if (!s.ok) {
|
|
198
|
+
k(s.error), a("error");
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
d(
|
|
201
|
+
d(s.value), a("ready"), s.value.status === "wip" && (g.current = setTimeout(_, e));
|
|
202
202
|
};
|
|
203
203
|
return _(), () => {
|
|
204
|
-
|
|
204
|
+
u = !0, w();
|
|
205
205
|
};
|
|
206
206
|
}, [t, e]), { state: n, manifest: i, error: h };
|
|
207
207
|
}
|
|
@@ -276,14 +276,14 @@ const kt = 640;
|
|
|
276
276
|
function _t(t, e) {
|
|
277
277
|
const [n, a] = v("auto"), [i, d] = v(null);
|
|
278
278
|
C(() => {
|
|
279
|
-
const
|
|
280
|
-
if (!
|
|
279
|
+
const u = t.current;
|
|
280
|
+
if (!u || (u.clientWidth > 0 && d(u.clientWidth), typeof ResizeObserver > "u")) return;
|
|
281
281
|
const w = new ResizeObserver((_) => {
|
|
282
|
-
var
|
|
283
|
-
const f = (
|
|
282
|
+
var s;
|
|
283
|
+
const f = (s = _[0]) == null ? void 0 : s.contentRect.width;
|
|
284
284
|
typeof f == "number" && f > 0 && d(f);
|
|
285
285
|
});
|
|
286
|
-
return w.observe(
|
|
286
|
+
return w.observe(u), () => w.disconnect();
|
|
287
287
|
}, [t]);
|
|
288
288
|
const h = i != null && i < kt ? "single" : e, k = n === "auto" ? h : n, g = L(() => {
|
|
289
289
|
a(k === "single" ? "double" : "single");
|
|
@@ -323,11 +323,11 @@ function vt(t) {
|
|
|
323
323
|
maxZoom: h,
|
|
324
324
|
total: k,
|
|
325
325
|
currentPage: g,
|
|
326
|
-
layout:
|
|
326
|
+
layout: u,
|
|
327
327
|
thumbsOpen: w,
|
|
328
328
|
isFullscreen: _,
|
|
329
329
|
downloadUrl: f,
|
|
330
|
-
show:
|
|
330
|
+
show: s,
|
|
331
331
|
onZoomIn: l,
|
|
332
332
|
onZoomOut: D,
|
|
333
333
|
onZoomSet: O,
|
|
@@ -348,9 +348,9 @@ function vt(t) {
|
|
|
348
348
|
F(P), z(String(P + 1));
|
|
349
349
|
};
|
|
350
350
|
return /* @__PURE__ */ y("div", { className: "peeek__toolbar", children: [
|
|
351
|
-
/* @__PURE__ */ r("span", { className: "peeek__label", children: n }),
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
!s.goto && /* @__PURE__ */ r("span", { className: "peeek__label", children: n }),
|
|
352
|
+
s.bar && /* @__PURE__ */ r("div", { className: "peeek__scrubber", "aria-hidden": !0, children: /* @__PURE__ */ r("div", { className: "peeek__scrubber-fill", style: { width: `${a}%` } }) }),
|
|
353
|
+
s.goto && /* @__PURE__ */ r(
|
|
354
354
|
"input",
|
|
355
355
|
{
|
|
356
356
|
className: "peeek__goto",
|
|
@@ -399,7 +399,7 @@ function vt(t) {
|
|
|
399
399
|
children: "+"
|
|
400
400
|
}
|
|
401
401
|
),
|
|
402
|
-
|
|
402
|
+
s.rotate && /* @__PURE__ */ r(
|
|
403
403
|
"button",
|
|
404
404
|
{
|
|
405
405
|
type: "button",
|
|
@@ -409,18 +409,18 @@ function vt(t) {
|
|
|
409
409
|
children: "⟳"
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
|
|
412
|
+
s.layoutToggle && /* @__PURE__ */ r(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
415
|
type: "button",
|
|
416
416
|
className: "peeek__btn",
|
|
417
|
-
"aria-label":
|
|
418
|
-
"aria-pressed":
|
|
417
|
+
"aria-label": u === "single" ? e.doublePage : e.singlePage,
|
|
418
|
+
"aria-pressed": u === "double",
|
|
419
419
|
onClick: x,
|
|
420
|
-
children:
|
|
420
|
+
children: u === "single" ? "▭" : "▥"
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
|
|
423
|
+
s.thumbnails && /* @__PURE__ */ r(
|
|
424
424
|
"button",
|
|
425
425
|
{
|
|
426
426
|
type: "button",
|
|
@@ -443,7 +443,7 @@ function vt(t) {
|
|
|
443
443
|
children: "↓"
|
|
444
444
|
}
|
|
445
445
|
),
|
|
446
|
-
|
|
446
|
+
s.fullscreen && /* @__PURE__ */ r(
|
|
447
447
|
"button",
|
|
448
448
|
{
|
|
449
449
|
type: "button",
|
|
@@ -454,7 +454,7 @@ function vt(t) {
|
|
|
454
454
|
children: "⛶"
|
|
455
455
|
}
|
|
456
456
|
),
|
|
457
|
-
|
|
457
|
+
s.about && /* @__PURE__ */ r(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
@@ -468,12 +468,12 @@ function vt(t) {
|
|
|
468
468
|
}
|
|
469
469
|
function wt({ pages: t, layout: e, rtl: n, activePages: a, onJump: i }) {
|
|
470
470
|
const d = t.length, h = new Set(a), k = me(d, e);
|
|
471
|
-
return /* @__PURE__ */ r("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: k }, (g,
|
|
472
|
-
const w = ge(
|
|
471
|
+
return /* @__PURE__ */ r("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: k }, (g, u) => {
|
|
472
|
+
const w = ge(u, d, e), _ = w.length === 2;
|
|
473
473
|
return /* @__PURE__ */ y("div", { className: "peeek__thumb-group", children: [
|
|
474
|
-
w.map((f,
|
|
474
|
+
w.map((f, s) => {
|
|
475
475
|
let l = "";
|
|
476
|
-
return _ && (l = (n ?
|
|
476
|
+
return _ && (l = (n ? s === 1 : s === 0) ? " peeek__thumb--flat-right" : " peeek__thumb--flat-left"), /* @__PURE__ */ r(
|
|
477
477
|
"button",
|
|
478
478
|
{
|
|
479
479
|
type: "button",
|
|
@@ -487,7 +487,7 @@ function wt({ pages: t, layout: e, rtl: n, activePages: a, onJump: i }) {
|
|
|
487
487
|
);
|
|
488
488
|
}),
|
|
489
489
|
/* @__PURE__ */ r("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children: w.map((f) => f + 1).join("-") })
|
|
490
|
-
] },
|
|
490
|
+
] }, u);
|
|
491
491
|
}) });
|
|
492
492
|
}
|
|
493
493
|
const ee = 1, ae = 4, Te = 0.5;
|
|
@@ -501,11 +501,11 @@ function Tt(t) {
|
|
|
501
501
|
animateInteractions: h,
|
|
502
502
|
autoTransition: k,
|
|
503
503
|
autoTransitionInterval: g,
|
|
504
|
-
show:
|
|
504
|
+
show: u,
|
|
505
505
|
downloadUrl: w,
|
|
506
506
|
isFullscreen: _,
|
|
507
507
|
onToggleFullscreen: f,
|
|
508
|
-
onAbout:
|
|
508
|
+
onAbout: s
|
|
509
509
|
} = t, l = e.length, O = Ce() || !h, [F, R] = v(0), [x, A] = v(1), [Z, j] = v(!1), [M, z] = v({ x: 0, y: 0 }), [B, P] = v(!1), [X, m] = v(0), p = E(null), S = E(null), { layout: b, toggle: K } = _t(S, a), oe = me(l, b), [T, le] = v(null), [xe, pe] = v(!1), ie = E(null), [be, Se] = v(0.707);
|
|
510
510
|
C(() => {
|
|
511
511
|
if (!e[0]) return;
|
|
@@ -516,9 +516,9 @@ function Tt(t) {
|
|
|
516
516
|
}, [e]);
|
|
517
517
|
const $ = ne(F, l, b), $e = $ <= 0, se = $ >= oe - 1, he = E(/* @__PURE__ */ new Set());
|
|
518
518
|
C(() => {
|
|
519
|
-
const o = [$ - 1, $ + 1, $ + 2].map((
|
|
520
|
-
for (const
|
|
521
|
-
const N = e[
|
|
519
|
+
const o = [$ - 1, $ + 1, $ + 2].map((c) => ne(c, l, b)).flatMap((c) => ge(c, l, b)).filter((c) => c >= 0);
|
|
520
|
+
for (const c of o) {
|
|
521
|
+
const N = e[c];
|
|
522
522
|
if (!N || he.current.has(N)) continue;
|
|
523
523
|
he.current.add(N);
|
|
524
524
|
const q = new globalThis.Image();
|
|
@@ -527,32 +527,32 @@ function Tt(t) {
|
|
|
527
527
|
}, [$, l, b, e]);
|
|
528
528
|
const W = L(
|
|
529
529
|
(o) => {
|
|
530
|
-
T || R((
|
|
531
|
-
const N = ne(
|
|
532
|
-
return N ===
|
|
530
|
+
T || R((c) => {
|
|
531
|
+
const N = ne(c + o, l, b);
|
|
532
|
+
return N === c ? c : O ? N : (le({ dir: o, to: N }), c);
|
|
533
533
|
});
|
|
534
534
|
},
|
|
535
535
|
[l, b, O, T]
|
|
536
536
|
), ze = L((o) => {
|
|
537
|
-
o.target === ie.current && (o.propertyName && o.propertyName !== "transform" || le((
|
|
537
|
+
o.target === ie.current && (o.propertyName && o.propertyName !== "transform" || le((c) => c && (R(c.to), pe(!0), requestAnimationFrame(
|
|
538
538
|
() => requestAnimationFrame(() => {
|
|
539
539
|
le(null), pe(!1);
|
|
540
540
|
})
|
|
541
|
-
),
|
|
541
|
+
), c)));
|
|
542
542
|
}, []);
|
|
543
543
|
C(() => {
|
|
544
544
|
if (!T) return;
|
|
545
545
|
const o = ie.current;
|
|
546
546
|
if (!o) return;
|
|
547
547
|
o.style.transform = "rotateY(0deg)";
|
|
548
|
-
let
|
|
548
|
+
let c = 0;
|
|
549
549
|
const N = requestAnimationFrame(() => {
|
|
550
|
-
|
|
550
|
+
c = requestAnimationFrame(() => {
|
|
551
551
|
o.style.transform = `rotateY(${T.dir === 1 ? -180 : 180}deg)`;
|
|
552
552
|
});
|
|
553
553
|
});
|
|
554
554
|
return () => {
|
|
555
|
-
cancelAnimationFrame(N), cancelAnimationFrame(
|
|
555
|
+
cancelAnimationFrame(N), cancelAnimationFrame(c);
|
|
556
556
|
};
|
|
557
557
|
}, [T]);
|
|
558
558
|
const ce = L(
|
|
@@ -568,19 +568,19 @@ function Tt(t) {
|
|
|
568
568
|
}, [k, g, se, $, W]);
|
|
569
569
|
const Fe = () => A((o) => Math.min(ae, o + Te)), Me = () => A((o) => Math.max(ee, o - Te)), Ee = () => {
|
|
570
570
|
T || A((o) => o > ee ? ee : ae);
|
|
571
|
-
}, Le = () => m((o) => (o + 90) % 360), De = X === 90 || X === 270 ? be : 1, ue = L((o,
|
|
571
|
+
}, Le = () => m((o) => (o + 90) % 360), De = X === 90 || X === 270 ? be : 1, ue = L((o, c, N) => {
|
|
572
572
|
const q = S.current;
|
|
573
573
|
if (!q || N <= 1) return { x: 0, y: 0 };
|
|
574
574
|
const ye = (N - 1) * q.clientWidth / 2, ve = (N - 1) * q.clientHeight / 2;
|
|
575
|
-
return { x: Math.max(-ye, Math.min(ye, o)), y: Math.max(-ve, Math.min(ve,
|
|
575
|
+
return { x: Math.max(-ye, Math.min(ye, o)), y: Math.max(-ve, Math.min(ve, c)) };
|
|
576
576
|
}, []);
|
|
577
577
|
C(() => z((o) => ue(o.x, o.y, x)), [x, ue]), C(() => z({ x: 0, y: 0 }), [$]);
|
|
578
578
|
const Oe = (o) => {
|
|
579
|
-
var
|
|
580
|
-
x <= 1 || (p.current = { x: o.clientX, y: o.clientY, px: M.x, py: M.y }, P(!0), (N = (
|
|
579
|
+
var c, N;
|
|
580
|
+
x <= 1 || (p.current = { x: o.clientX, y: o.clientY, px: M.x, py: M.y }, P(!0), (N = (c = o.currentTarget).setPointerCapture) == null || N.call(c, o.pointerId));
|
|
581
581
|
}, Re = (o) => {
|
|
582
|
-
const
|
|
583
|
-
|
|
582
|
+
const c = p.current;
|
|
583
|
+
c && z(ue(c.px + (o.clientX - c.x), c.py + (o.clientY - c.y), x));
|
|
584
584
|
}, ke = (o) => {
|
|
585
585
|
if (p.current) {
|
|
586
586
|
p.current = null, P(!1);
|
|
@@ -604,7 +604,7 @@ function Tt(t) {
|
|
|
604
604
|
onKeyDown: Ae,
|
|
605
605
|
style: { "--peeek-aspect": `${be}` },
|
|
606
606
|
children: [
|
|
607
|
-
|
|
607
|
+
u.arrows && /* @__PURE__ */ r(
|
|
608
608
|
"button",
|
|
609
609
|
{
|
|
610
610
|
type: "button",
|
|
@@ -634,22 +634,22 @@ function Tt(t) {
|
|
|
634
634
|
className: `peeek__spread${d ? " peeek--shadows" : ""}${Xe ? " peeek__spread--pair" : ""}`,
|
|
635
635
|
style: { transform: `translateX(${Ke})` },
|
|
636
636
|
children: [
|
|
637
|
-
Je.map(([o,
|
|
638
|
-
const N =
|
|
637
|
+
Je.map(([o, c]) => {
|
|
638
|
+
const N = c >= 0 && u.fullscreen && !_ && !T && x === 1;
|
|
639
639
|
return /* @__PURE__ */ r(
|
|
640
640
|
"div",
|
|
641
641
|
{
|
|
642
|
-
className: `peeek__page peeek__page--${o}${
|
|
643
|
-
children:
|
|
642
|
+
className: `peeek__page peeek__page--${o}${c < 0 ? " peeek__page--empty" : ""}`,
|
|
643
|
+
children: c >= 0 && (N ? /* @__PURE__ */ r(
|
|
644
644
|
"button",
|
|
645
645
|
{
|
|
646
646
|
type: "button",
|
|
647
647
|
className: "peeek__page-btn",
|
|
648
648
|
"aria-label": n.openFullscreen,
|
|
649
649
|
onClick: f,
|
|
650
|
-
children: /* @__PURE__ */ r("img", { src: e[
|
|
650
|
+
children: /* @__PURE__ */ r("img", { src: e[c], alt: `Page ${c + 1}`, referrerPolicy: "no-referrer" })
|
|
651
651
|
}
|
|
652
|
-
) : /* @__PURE__ */ r("img", { src: e[
|
|
652
|
+
) : /* @__PURE__ */ r("img", { src: e[c], alt: `Page ${c + 1}`, referrerPolicy: "no-referrer" }))
|
|
653
653
|
},
|
|
654
654
|
o
|
|
655
655
|
);
|
|
@@ -671,7 +671,7 @@ function Tt(t) {
|
|
|
671
671
|
)
|
|
672
672
|
}
|
|
673
673
|
),
|
|
674
|
-
|
|
674
|
+
u.arrows && /* @__PURE__ */ r(
|
|
675
675
|
"button",
|
|
676
676
|
{
|
|
677
677
|
type: "button",
|
|
@@ -685,7 +685,7 @@ function Tt(t) {
|
|
|
685
685
|
]
|
|
686
686
|
}
|
|
687
687
|
),
|
|
688
|
-
|
|
688
|
+
u.toolbar && /* @__PURE__ */ r(
|
|
689
689
|
vt,
|
|
690
690
|
{
|
|
691
691
|
strings: n,
|
|
@@ -701,13 +701,13 @@ function Tt(t) {
|
|
|
701
701
|
isFullscreen: _,
|
|
702
702
|
downloadUrl: w,
|
|
703
703
|
show: {
|
|
704
|
-
bar:
|
|
705
|
-
fullscreen:
|
|
706
|
-
thumbnails:
|
|
707
|
-
about:
|
|
708
|
-
goto:
|
|
709
|
-
rotate:
|
|
710
|
-
layoutToggle:
|
|
704
|
+
bar: u.bar,
|
|
705
|
+
fullscreen: u.fullscreen,
|
|
706
|
+
thumbnails: u.thumbnails && u.overview,
|
|
707
|
+
about: u.about,
|
|
708
|
+
goto: u.goto,
|
|
709
|
+
rotate: u.rotate,
|
|
710
|
+
layoutToggle: u.layoutToggle
|
|
711
711
|
},
|
|
712
712
|
onZoomIn: Fe,
|
|
713
713
|
onZoomOut: Me,
|
|
@@ -717,10 +717,10 @@ function Tt(t) {
|
|
|
717
717
|
onToggleLayout: K,
|
|
718
718
|
onToggleThumbs: () => j((o) => !o),
|
|
719
719
|
onToggleFullscreen: f,
|
|
720
|
-
onAbout:
|
|
720
|
+
onAbout: s
|
|
721
721
|
}
|
|
722
722
|
),
|
|
723
|
-
|
|
723
|
+
u.overview && Z && /* @__PURE__ */ r(wt, { pages: e, layout: b, rtl: i, activePages: Y, onJump: ce })
|
|
724
724
|
] });
|
|
725
725
|
}
|
|
726
726
|
function Nt(t, e) {
|
|
@@ -750,26 +750,26 @@ function Pt(t) {
|
|
|
750
750
|
autoTransition: h,
|
|
751
751
|
autoTransitionInterval: k,
|
|
752
752
|
downloadUrl: g,
|
|
753
|
-
isFullscreen:
|
|
753
|
+
isFullscreen: u,
|
|
754
754
|
onToggleFullscreen: w,
|
|
755
755
|
onAbout: _,
|
|
756
756
|
show: f
|
|
757
|
-
} = t,
|
|
758
|
-
(m) => D((p) => Math.max(0, Math.min(
|
|
759
|
-
[
|
|
757
|
+
} = t, s = e.length, [l, D] = v(0), O = Ce(), F = L(
|
|
758
|
+
(m) => D((p) => Math.max(0, Math.min(s - 1, p + m))),
|
|
759
|
+
[s]
|
|
760
760
|
), R = L(
|
|
761
|
-
(m) => D(Math.max(0, Math.min(
|
|
762
|
-
[
|
|
763
|
-
), x = l <= 0, A = l >=
|
|
761
|
+
(m) => D(Math.max(0, Math.min(s - 1, m))),
|
|
762
|
+
[s]
|
|
763
|
+
), x = l <= 0, A = l >= s - 1, Z = E(/* @__PURE__ */ new Set());
|
|
764
764
|
C(() => {
|
|
765
765
|
for (const m of [l - 2, l - 1, l + 1, l + 2]) {
|
|
766
|
-
const p = m >= 0 && m <
|
|
766
|
+
const p = m >= 0 && m < s ? e[m] : void 0;
|
|
767
767
|
if (!p || Z.current.has(p)) continue;
|
|
768
768
|
Z.current.add(p);
|
|
769
769
|
const S = new globalThis.Image();
|
|
770
770
|
S.src = p;
|
|
771
771
|
}
|
|
772
|
-
}, [l,
|
|
772
|
+
}, [l, s, e]);
|
|
773
773
|
const j = E([]);
|
|
774
774
|
C(() => {
|
|
775
775
|
var m, p;
|
|
@@ -779,10 +779,10 @@ function Pt(t) {
|
|
|
779
779
|
const m = setTimeout(() => F(1), k);
|
|
780
780
|
return () => clearTimeout(m);
|
|
781
781
|
}, [h, k, O, A, l, F]);
|
|
782
|
-
const { onKeyDown: M } = Pe({ go: F, jump: R, total:
|
|
782
|
+
const { onKeyDown: M } = Pe({ go: F, jump: R, total: s, rtl: d }), [z, B] = v(String(l + 1));
|
|
783
783
|
C(() => B(String(l + 1)), [l]);
|
|
784
784
|
const P = () => {
|
|
785
|
-
const m = Ie(z,
|
|
785
|
+
const m = Ie(z, s);
|
|
786
786
|
if (m === null) {
|
|
787
787
|
B(String(l + 1));
|
|
788
788
|
return;
|
|
@@ -795,15 +795,15 @@ function Pt(t) {
|
|
|
795
795
|
/* @__PURE__ */ y("div", { className: "peeek__cf-meta", children: [
|
|
796
796
|
/* @__PURE__ */ r("span", { className: "peeek__cf-name", children: a }),
|
|
797
797
|
/* @__PURE__ */ y("span", { className: "peeek__cf-count", children: [
|
|
798
|
-
|
|
798
|
+
s,
|
|
799
799
|
" ",
|
|
800
|
-
|
|
800
|
+
s === 1 ? n.page : n.pages
|
|
801
801
|
] })
|
|
802
802
|
] }),
|
|
803
803
|
/* @__PURE__ */ y("span", { className: "peeek__cf-indicator", children: [
|
|
804
804
|
l + 1,
|
|
805
805
|
" / ",
|
|
806
|
-
|
|
806
|
+
s
|
|
807
807
|
] }),
|
|
808
808
|
f.goto && /* @__PURE__ */ r(
|
|
809
809
|
"input",
|
|
@@ -836,9 +836,9 @@ function Pt(t) {
|
|
|
836
836
|
"button",
|
|
837
837
|
{
|
|
838
838
|
type: "button",
|
|
839
|
-
className: `peeek__btn${
|
|
839
|
+
className: `peeek__btn${u ? " peeek__btn--active" : ""}`,
|
|
840
840
|
"aria-label": n.fullscreen,
|
|
841
|
-
"aria-pressed":
|
|
841
|
+
"aria-pressed": u,
|
|
842
842
|
onClick: w,
|
|
843
843
|
children: "⛶"
|
|
844
844
|
}
|
|
@@ -1027,7 +1027,7 @@ function St({ strings: t, onClose: e }) {
|
|
|
1027
1027
|
/* @__PURE__ */ r("div", { className: "peeek__about-tagline", children: t.aboutTagline }),
|
|
1028
1028
|
/* @__PURE__ */ y("div", { className: "peeek__about-version", children: [
|
|
1029
1029
|
"v",
|
|
1030
|
-
"0.4.
|
|
1030
|
+
"0.4.9"
|
|
1031
1031
|
] }),
|
|
1032
1032
|
/* @__PURE__ */ r("p", { className: "peeek__about-desc", children: t.aboutDescription }),
|
|
1033
1033
|
/* @__PURE__ */ r(
|
|
@@ -1046,13 +1046,13 @@ function St({ strings: t, onClose: e }) {
|
|
|
1046
1046
|
) });
|
|
1047
1047
|
}
|
|
1048
1048
|
function Ft(t) {
|
|
1049
|
-
const e = gt(t), n = dt(e.language), a = E(null), { isFullscreen: i, toggle: d } = ht(a), [h, k] = v(!1), g = t.pages !== void 0,
|
|
1049
|
+
const e = gt(t), n = dt(e.language), a = E(null), { isFullscreen: i, toggle: d } = ht(a), [h, k] = v(!1), g = t.pages !== void 0, u = et(
|
|
1050
1050
|
() => g ? pt(t.pages, { filename: t.filename, mimeType: t.mimeType }) : null,
|
|
1051
1051
|
[g, t.pages, t.filename, t.mimeType]
|
|
1052
|
-
), w = bt(g ? null : e.src, e.pollInterval), _ = g ?
|
|
1052
|
+
), w = bt(g ? null : e.src, e.pollInterval), _ = g ? u : w.manifest, f = g ? u ? "ready" : "loading" : w.state, s = {
|
|
1053
1053
|
"--peeek-accent": e.accentColor
|
|
1054
1054
|
};
|
|
1055
|
-
e.background === "transparent" ?
|
|
1055
|
+
e.background === "transparent" ? s["--peeek-bg"] = "transparent" : e.background === "color" && e.backgroundColor ? s["--peeek-bg"] = e.backgroundColor : e.background === "image" && e.backgroundImage && (s["--peeek-bg"] = `center / cover no-repeat url("${e.backgroundImage}")`);
|
|
1056
1056
|
const l = {
|
|
1057
1057
|
toolbar: e.navigationControls,
|
|
1058
1058
|
bar: e.navigationBar,
|
|
@@ -1073,7 +1073,7 @@ function Ft(t) {
|
|
|
1073
1073
|
"data-skin": e.skin,
|
|
1074
1074
|
"data-layout": e.layout,
|
|
1075
1075
|
dir: e.rtl ? "rtl" : void 0,
|
|
1076
|
-
style:
|
|
1076
|
+
style: s,
|
|
1077
1077
|
children: [
|
|
1078
1078
|
/* @__PURE__ */ r(It, { logo: e.logo, logoLink: e.logoLink }),
|
|
1079
1079
|
f === "loading" && /* @__PURE__ */ y("div", { className: "peeek__state", style: e.loadingColor ? { color: e.loadingColor } : void 0, children: [
|