pdfjs-reader-core 0.5.9 → 0.5.11
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.cjs +30 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +30 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1903,6 +1903,15 @@ function detectDeviceCapabilities() {
|
|
|
1903
1903
|
screenSize
|
|
1904
1904
|
};
|
|
1905
1905
|
}
|
|
1906
|
+
function isIOSMobile() {
|
|
1907
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") {
|
|
1908
|
+
return false;
|
|
1909
|
+
}
|
|
1910
|
+
const ua = navigator.userAgent || "";
|
|
1911
|
+
if (/iPhone|iPad|iPod/i.test(ua)) return true;
|
|
1912
|
+
const isAppleTouch = /Mac/i.test(ua) && typeof navigator.maxTouchPoints === "number" && navigator.maxTouchPoints > 1;
|
|
1913
|
+
return isAppleTouch;
|
|
1914
|
+
}
|
|
1906
1915
|
function getRenderConfig(quality = "auto", capabilities) {
|
|
1907
1916
|
const caps = capabilities ?? detectDeviceCapabilities();
|
|
1908
1917
|
if (quality === "auto") {
|
|
@@ -13325,8 +13334,8 @@ var ACCENT_SOFT = "rgba(176, 74, 26, 0.18)";
|
|
|
13325
13334
|
var ACCENT_GLOW = "rgba(176, 74, 26, 0.35)";
|
|
13326
13335
|
var SERIF = "'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'EB Garamond', 'Hoefler Text', Georgia, serif";
|
|
13327
13336
|
var EASE_OUT_EXPO = [0.22, 1, 0.36, 1];
|
|
13328
|
-
var PILL_FONT_CAPS = "clamp(
|
|
13329
|
-
var PILL_FONT_BODY = "clamp(
|
|
13337
|
+
var PILL_FONT_CAPS = "clamp(9px, 0.55vw + 7px, 13px)";
|
|
13338
|
+
var PILL_FONT_BODY = "clamp(10.5px, 0.6vw + 8.5px, 15px)";
|
|
13330
13339
|
var PILL_FONT_DISPLAY = "clamp(14px, 0.75vw + 12px, 19px)";
|
|
13331
13340
|
var PILL_MAX_W_CAPS = "clamp(180px, 26vw, 380px)";
|
|
13332
13341
|
var PILL_MAX_W_BODY = "clamp(200px, 28vw, 440px)";
|
|
@@ -13337,8 +13346,8 @@ function resolveMaxPillW(viewportWidthPx) {
|
|
|
13337
13346
|
return clamp(0.26 * viewportWidthPx, 180, 380);
|
|
13338
13347
|
}
|
|
13339
13348
|
function resolveMaxPillH(viewportWidthPx) {
|
|
13340
|
-
const font = clamp(55e-4 * viewportWidthPx +
|
|
13341
|
-
return clamp(font * 2.6,
|
|
13349
|
+
const font = clamp(55e-4 * viewportWidthPx + 7, 9, 13);
|
|
13350
|
+
return clamp(font * 2.6, 24, 36);
|
|
13342
13351
|
}
|
|
13343
13352
|
function clamp(v, lo, hi) {
|
|
13344
13353
|
return Math.min(hi, Math.max(lo, v));
|
|
@@ -14594,13 +14603,14 @@ function StickyLabel({ screenAnchor, action }) {
|
|
|
14594
14603
|
textTransform: "uppercase",
|
|
14595
14604
|
fontWeight: 500,
|
|
14596
14605
|
// Wrap instead of truncating with an ellipsis. Short labels stay
|
|
14597
|
-
// single-line
|
|
14598
|
-
//
|
|
14599
|
-
//
|
|
14600
|
-
//
|
|
14606
|
+
// single-line; longer ones grow in height rather than losing
|
|
14607
|
+
// their tail. `overflowWrap: 'break-word'` respects min-content
|
|
14608
|
+
// sizing so a single overflowing word mid-breaks at a safe
|
|
14609
|
+
// boundary — unlike `anywhere`, which would collapse the pill
|
|
14610
|
+
// to 1-char min width and stack every letter on its own line.
|
|
14601
14611
|
maxWidth: PILL_MAX_W_BODY,
|
|
14602
14612
|
whiteSpace: "normal",
|
|
14603
|
-
overflowWrap: "
|
|
14613
|
+
overflowWrap: "break-word",
|
|
14604
14614
|
// Warm two-layer shadow (matches GhostReference's palette).
|
|
14605
14615
|
boxShadow: "0 1px 2px rgba(42, 36, 32, 0.12), 0 8px 18px -6px rgba(42, 36, 32, 0.22)",
|
|
14606
14616
|
// Internal left accent rule — a 2px terracotta stripe.
|
|
@@ -14899,11 +14909,13 @@ function CalloutLabelPill({
|
|
|
14899
14909
|
fontWeight: 500,
|
|
14900
14910
|
// Wrap instead of truncating. Short labels stay single-line;
|
|
14901
14911
|
// longer ones grow taller rather than losing their tail to an
|
|
14902
|
-
// ellipsis. `overflowWrap: '
|
|
14903
|
-
//
|
|
14912
|
+
// ellipsis. `overflowWrap: 'break-word'` respects min-content
|
|
14913
|
+
// sizing — `anywhere` here caused the pill to collapse to 1-char
|
|
14914
|
+
// width and stack each letter on its own line when the clamped
|
|
14915
|
+
// maxWidth was narrow.
|
|
14904
14916
|
maxWidth: PILL_MAX_W_CAPS,
|
|
14905
14917
|
whiteSpace: "normal",
|
|
14906
|
-
overflowWrap: "
|
|
14918
|
+
overflowWrap: "break-word",
|
|
14907
14919
|
boxShadow: "0 1px 2px rgba(42, 36, 32, 0.12), 0 8px 18px -6px rgba(42, 36, 32, 0.22)",
|
|
14908
14920
|
// Accent rule on the "inward" edge (the one closest to the arrow).
|
|
14909
14921
|
backgroundImage: spec.accentGradient,
|
|
@@ -14993,6 +15005,7 @@ function SubtitleBar({ text }) {
|
|
|
14993
15005
|
// src/director/storyboard-engine.ts
|
|
14994
15006
|
init_narration_store();
|
|
14995
15007
|
init_camera_math();
|
|
15008
|
+
init_mobile_config();
|
|
14996
15009
|
var DEFAULT_MIN_OVERLAY_MS = 3500;
|
|
14997
15010
|
var StoryboardEngine = class {
|
|
14998
15011
|
constructor(deps) {
|
|
@@ -15012,6 +15025,7 @@ var StoryboardEngine = class {
|
|
|
15012
15025
|
this.overlayRemovalTimers = /* @__PURE__ */ new Map();
|
|
15013
15026
|
this.currentStoryboardId = 0;
|
|
15014
15027
|
this.deps = deps;
|
|
15028
|
+
this.singleActiveOverlay = deps.singleActiveOverlay ?? isIOSMobile();
|
|
15015
15029
|
}
|
|
15016
15030
|
/**
|
|
15017
15031
|
* Execute a new storyboard. Cancels in-flight steps from the previous storyboard
|
|
@@ -15181,6 +15195,10 @@ var StoryboardEngine = class {
|
|
|
15181
15195
|
createdAt: Date.now(),
|
|
15182
15196
|
expiresAt: Date.now() + visibleMs
|
|
15183
15197
|
};
|
|
15198
|
+
if (this.singleActiveOverlay) {
|
|
15199
|
+
this.cancelAllRemovalTimers();
|
|
15200
|
+
narrationStore.getState().clearOverlays();
|
|
15201
|
+
}
|
|
15184
15202
|
narrationStore.getState().addOverlay(overlay);
|
|
15185
15203
|
const timer = setTimeout(() => {
|
|
15186
15204
|
narrationStore.getState().removeOverlay(overlay.id);
|