pdfjs-reader-core 0.5.1 → 0.5.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/index.cjs +48 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12998,6 +12998,24 @@ var ACCENT_SOFT = "rgba(176, 74, 26, 0.18)";
|
|
|
12998
12998
|
var ACCENT_GLOW = "rgba(176, 74, 26, 0.35)";
|
|
12999
12999
|
var SERIF = "'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'EB Garamond', 'Hoefler Text', Georgia, serif";
|
|
13000
13000
|
var EASE_OUT_EXPO = [0.22, 1, 0.36, 1];
|
|
13001
|
+
var PILL_FONT_CAPS = "clamp(10.5px, 0.55vw + 8.5px, 14.5px)";
|
|
13002
|
+
var PILL_FONT_BODY = "clamp(12px, 0.6vw + 10px, 16.5px)";
|
|
13003
|
+
var PILL_FONT_DISPLAY = "clamp(14px, 0.75vw + 12px, 19px)";
|
|
13004
|
+
var PILL_MAX_W_CAPS = "clamp(180px, 26vw, 380px)";
|
|
13005
|
+
var PILL_MAX_W_BODY = "clamp(200px, 28vw, 440px)";
|
|
13006
|
+
function resolvePillOffset(viewportWidthPx) {
|
|
13007
|
+
return clamp(0.022 * viewportWidthPx + 12, 20, 44);
|
|
13008
|
+
}
|
|
13009
|
+
function resolveMaxPillW(viewportWidthPx) {
|
|
13010
|
+
return clamp(0.26 * viewportWidthPx, 180, 380);
|
|
13011
|
+
}
|
|
13012
|
+
function resolveMaxPillH(viewportWidthPx) {
|
|
13013
|
+
const font = clamp(55e-4 * viewportWidthPx + 8.5, 10.5, 14.5);
|
|
13014
|
+
return clamp(font * 2.6, 28, 42);
|
|
13015
|
+
}
|
|
13016
|
+
function clamp(v, lo, hi) {
|
|
13017
|
+
return Math.min(hi, Math.max(lo, v));
|
|
13018
|
+
}
|
|
13001
13019
|
|
|
13002
13020
|
// src/components/TutorMode/SpotlightMask.tsx
|
|
13003
13021
|
import { jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
@@ -13910,9 +13928,11 @@ function GhostReference({
|
|
|
13910
13928
|
{
|
|
13911
13929
|
style: {
|
|
13912
13930
|
position: "relative",
|
|
13913
|
-
|
|
13931
|
+
// Padding scales with viewport: compact on phones, breathing on
|
|
13932
|
+
// desktop. Extra 4px on the left preserves the footnote-rule gap.
|
|
13933
|
+
padding: "clamp(14px, 1.4vw + 10px, 26px) clamp(14px, 1.4vw + 10px, 26px) clamp(14px, 1.4vw + 10px, 26px) clamp(18px, 1.4vw + 14px, 30px)",
|
|
13914
13934
|
display: "flex",
|
|
13915
|
-
gap:
|
|
13935
|
+
gap: "clamp(12px, 1.1vw + 8px, 20px)",
|
|
13916
13936
|
alignItems: "flex-start"
|
|
13917
13937
|
},
|
|
13918
13938
|
children: [
|
|
@@ -13926,7 +13946,7 @@ function GhostReference({
|
|
|
13926
13946
|
transition: { duration: 0.45, delay: 0.18, ease: [0.22, 1, 0.36, 1] },
|
|
13927
13947
|
style: {
|
|
13928
13948
|
flexShrink: 0,
|
|
13929
|
-
width:
|
|
13949
|
+
width: "clamp(40px, 4vw + 20px, 64px)",
|
|
13930
13950
|
aspectRatio: `${page.width} / ${page.height}`,
|
|
13931
13951
|
background: PAPER_DEEP,
|
|
13932
13952
|
borderRadius: 2,
|
|
@@ -13991,7 +14011,7 @@ function GhostReference({
|
|
|
13991
14011
|
flex: 1,
|
|
13992
14012
|
minWidth: 0,
|
|
13993
14013
|
fontFamily: SERIF2,
|
|
13994
|
-
fontSize:
|
|
14014
|
+
fontSize: PILL_FONT_DISPLAY,
|
|
13995
14015
|
lineHeight: 1.55,
|
|
13996
14016
|
color: INK2,
|
|
13997
14017
|
fontFeatureSettings: "'liga' 1, 'kern' 1, 'onum' 1",
|
|
@@ -14013,7 +14033,7 @@ function GhostReference({
|
|
|
14013
14033
|
left: -14,
|
|
14014
14034
|
top: -2,
|
|
14015
14035
|
color: ACCENT2,
|
|
14016
|
-
fontSize:
|
|
14036
|
+
fontSize: "clamp(18px, 1vw + 14px, 28px)",
|
|
14017
14037
|
lineHeight: 1,
|
|
14018
14038
|
fontWeight: 500
|
|
14019
14039
|
// ornamental flourish anchoring the paragraph
|
|
@@ -14123,10 +14143,6 @@ import { AnimatePresence as AnimatePresence3 } from "framer-motion";
|
|
|
14123
14143
|
// src/components/TutorMode/StickyLabel.tsx
|
|
14124
14144
|
import { motion as motion9 } from "framer-motion";
|
|
14125
14145
|
import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
14126
|
-
var INK3 = "#2a2420";
|
|
14127
|
-
var PAPER3 = "#faf6ec";
|
|
14128
|
-
var ACCENT3 = "#b04a1a";
|
|
14129
|
-
var SERIF3 = "'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'EB Garamond', 'Hoefler Text', Georgia, serif";
|
|
14130
14146
|
var STEM = 18;
|
|
14131
14147
|
function StickyLabel({ screenAnchor, action }) {
|
|
14132
14148
|
const { x, y } = screenAnchor;
|
|
@@ -14165,7 +14181,7 @@ function StickyLabel({ screenAnchor, action }) {
|
|
|
14165
14181
|
transition: { duration: 0.35, ease: [0.22, 1, 0.36, 1] },
|
|
14166
14182
|
style: {
|
|
14167
14183
|
position: "absolute",
|
|
14168
|
-
background:
|
|
14184
|
+
background: ACCENT,
|
|
14169
14185
|
transformOrigin: layout.stemOrigin,
|
|
14170
14186
|
...layout.stem
|
|
14171
14187
|
}
|
|
@@ -14184,8 +14200,8 @@ function StickyLabel({ screenAnchor, action }) {
|
|
|
14184
14200
|
width: 6,
|
|
14185
14201
|
height: 6,
|
|
14186
14202
|
borderRadius: "50%",
|
|
14187
|
-
background:
|
|
14188
|
-
boxShadow: `0 0 0 2px ${
|
|
14203
|
+
background: ACCENT,
|
|
14204
|
+
boxShadow: `0 0 0 2px ${PAPER}, 0 0 0 3px rgba(176, 74, 26, 0.25)`,
|
|
14189
14205
|
...layout.dot
|
|
14190
14206
|
}
|
|
14191
14207
|
}
|
|
@@ -14200,25 +14216,25 @@ function StickyLabel({ screenAnchor, action }) {
|
|
|
14200
14216
|
style: {
|
|
14201
14217
|
position: "absolute",
|
|
14202
14218
|
...layout.bodyAnchor,
|
|
14203
|
-
background:
|
|
14204
|
-
color:
|
|
14219
|
+
background: PAPER,
|
|
14220
|
+
color: INK,
|
|
14205
14221
|
border: "1px solid rgba(42, 36, 32, 0.10)",
|
|
14206
14222
|
borderRadius: 3,
|
|
14207
14223
|
padding: "6px 12px 6px 14px",
|
|
14208
|
-
fontFamily:
|
|
14209
|
-
fontSize:
|
|
14224
|
+
fontFamily: SERIF,
|
|
14225
|
+
fontSize: PILL_FONT_BODY,
|
|
14210
14226
|
lineHeight: 1.25,
|
|
14211
14227
|
letterSpacing: 0.6,
|
|
14212
14228
|
textTransform: "uppercase",
|
|
14213
14229
|
fontWeight: 500,
|
|
14214
14230
|
whiteSpace: "nowrap",
|
|
14215
|
-
maxWidth:
|
|
14231
|
+
maxWidth: PILL_MAX_W_BODY,
|
|
14216
14232
|
overflow: "hidden",
|
|
14217
14233
|
textOverflow: "ellipsis",
|
|
14218
14234
|
// Warm two-layer shadow (matches GhostReference's palette).
|
|
14219
14235
|
boxShadow: "0 1px 2px rgba(42, 36, 32, 0.12), 0 8px 18px -6px rgba(42, 36, 32, 0.22)",
|
|
14220
14236
|
// Internal left accent rule — a 2px terracotta stripe.
|
|
14221
|
-
backgroundImage: `linear-gradient(to right, ${
|
|
14237
|
+
backgroundImage: `linear-gradient(to right, ${ACCENT} 0, ${ACCENT} 2px, transparent 2px)`,
|
|
14222
14238
|
backgroundRepeat: "no-repeat",
|
|
14223
14239
|
backgroundSize: "2px 100%",
|
|
14224
14240
|
backgroundPosition: "left top"
|
|
@@ -14460,9 +14476,9 @@ function computePillAnchor(fromBbox, toBbox, page, camera, viewport) {
|
|
|
14460
14476
|
const tipScreenX = viewport.width / 2 + camera.x + (toX - pageCX) * camera.scale;
|
|
14461
14477
|
const tipScreenY = viewport.height / 2 + camera.y + (toY - pageCY) * camera.scale;
|
|
14462
14478
|
const isVertical = Math.abs(dy) >= Math.abs(dx);
|
|
14463
|
-
const OFFSET =
|
|
14464
|
-
const MAX_PILL_W =
|
|
14465
|
-
const MAX_PILL_H =
|
|
14479
|
+
const OFFSET = resolvePillOffset(viewport.width);
|
|
14480
|
+
const MAX_PILL_W = resolveMaxPillW(viewport.width);
|
|
14481
|
+
const MAX_PILL_H = resolveMaxPillH(viewport.width);
|
|
14466
14482
|
const SAFE = 16;
|
|
14467
14483
|
if (isVertical) {
|
|
14468
14484
|
const canFitRight = tipScreenX + OFFSET + MAX_PILL_W < viewport.width - SAFE;
|
|
@@ -14506,13 +14522,13 @@ function CalloutLabelPill({
|
|
|
14506
14522
|
borderRadius: 3,
|
|
14507
14523
|
padding: spec.padding,
|
|
14508
14524
|
fontFamily: SERIF,
|
|
14509
|
-
fontSize:
|
|
14525
|
+
fontSize: PILL_FONT_CAPS,
|
|
14510
14526
|
lineHeight: 1.2,
|
|
14511
14527
|
letterSpacing: 0.6,
|
|
14512
14528
|
textTransform: "uppercase",
|
|
14513
14529
|
fontWeight: 500,
|
|
14514
14530
|
whiteSpace: "nowrap",
|
|
14515
|
-
maxWidth:
|
|
14531
|
+
maxWidth: PILL_MAX_W_CAPS,
|
|
14516
14532
|
overflow: "hidden",
|
|
14517
14533
|
textOverflow: "ellipsis",
|
|
14518
14534
|
boxShadow: "0 1px 2px rgba(42, 36, 32, 0.12), 0 8px 18px -6px rgba(42, 36, 32, 0.22)",
|
|
@@ -15402,32 +15418,32 @@ function clampNumericRanges(input) {
|
|
|
15402
15418
|
}
|
|
15403
15419
|
const type = typeof out.type === "string" ? out.type : void 0;
|
|
15404
15420
|
if (type === "camera") {
|
|
15405
|
-
if (typeof out.scale === "number") out.scale =
|
|
15421
|
+
if (typeof out.scale === "number") out.scale = clamp2(out.scale, 0.5, 4);
|
|
15406
15422
|
if (typeof out.padding === "number") {
|
|
15407
|
-
out.padding =
|
|
15423
|
+
out.padding = clamp2(out.padding, 0, 400);
|
|
15408
15424
|
}
|
|
15409
15425
|
}
|
|
15410
15426
|
if (typeof out.dim_opacity === "number") {
|
|
15411
|
-
out.dim_opacity =
|
|
15427
|
+
out.dim_opacity = clamp2(out.dim_opacity, 0, 1);
|
|
15412
15428
|
}
|
|
15413
15429
|
if (typeof out.feather_px === "number") {
|
|
15414
|
-
out.feather_px =
|
|
15430
|
+
out.feather_px = clamp2(out.feather_px, 0, 200);
|
|
15415
15431
|
}
|
|
15416
15432
|
if (typeof out.draw_duration_ms === "number") {
|
|
15417
|
-
out.draw_duration_ms =
|
|
15433
|
+
out.draw_duration_ms = clamp2(out.draw_duration_ms, 100, 3e3);
|
|
15418
15434
|
}
|
|
15419
15435
|
if (typeof out.count === "number") {
|
|
15420
|
-
out.count = Math.round(
|
|
15436
|
+
out.count = Math.round(clamp2(out.count, 1, 5));
|
|
15421
15437
|
}
|
|
15422
15438
|
if (typeof out.at_ms === "number") {
|
|
15423
|
-
out.at_ms =
|
|
15439
|
+
out.at_ms = clamp2(out.at_ms, 0, 5e3);
|
|
15424
15440
|
}
|
|
15425
15441
|
if (typeof out.duration_ms === "number" && type === void 0) {
|
|
15426
|
-
out.duration_ms =
|
|
15442
|
+
out.duration_ms = clamp2(out.duration_ms, 100, 5e3);
|
|
15427
15443
|
}
|
|
15428
15444
|
return out;
|
|
15429
15445
|
}
|
|
15430
|
-
function
|
|
15446
|
+
function clamp2(v, lo, hi) {
|
|
15431
15447
|
return Math.min(hi, Math.max(lo, v));
|
|
15432
15448
|
}
|
|
15433
15449
|
function enforceOverlayPresence(sb) {
|