pdfjs-reader-core 0.5.1 → 0.5.4

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 CHANGED
@@ -13183,6 +13183,24 @@ var ACCENT_SOFT = "rgba(176, 74, 26, 0.18)";
13183
13183
  var ACCENT_GLOW = "rgba(176, 74, 26, 0.35)";
13184
13184
  var SERIF = "'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'EB Garamond', 'Hoefler Text', Georgia, serif";
13185
13185
  var EASE_OUT_EXPO = [0.22, 1, 0.36, 1];
13186
+ var PILL_FONT_CAPS = "clamp(10.5px, 0.55vw + 8.5px, 14.5px)";
13187
+ var PILL_FONT_BODY = "clamp(12px, 0.6vw + 10px, 16.5px)";
13188
+ var PILL_FONT_DISPLAY = "clamp(14px, 0.75vw + 12px, 19px)";
13189
+ var PILL_MAX_W_CAPS = "clamp(180px, 26vw, 380px)";
13190
+ var PILL_MAX_W_BODY = "clamp(200px, 28vw, 440px)";
13191
+ function resolvePillOffset(viewportWidthPx) {
13192
+ return clamp(0.022 * viewportWidthPx + 12, 20, 44);
13193
+ }
13194
+ function resolveMaxPillW(viewportWidthPx) {
13195
+ return clamp(0.26 * viewportWidthPx, 180, 380);
13196
+ }
13197
+ function resolveMaxPillH(viewportWidthPx) {
13198
+ const font = clamp(55e-4 * viewportWidthPx + 8.5, 10.5, 14.5);
13199
+ return clamp(font * 2.6, 28, 42);
13200
+ }
13201
+ function clamp(v, lo, hi) {
13202
+ return Math.min(hi, Math.max(lo, v));
13203
+ }
13186
13204
 
13187
13205
  // src/components/TutorMode/SpotlightMask.tsx
13188
13206
  var import_jsx_runtime42 = require("react/jsx-runtime");
@@ -14095,9 +14113,11 @@ function GhostReference({
14095
14113
  {
14096
14114
  style: {
14097
14115
  position: "relative",
14098
- padding: "20px 22px 20px 26px",
14116
+ // Padding scales with viewport: compact on phones, breathing on
14117
+ // desktop. Extra 4px on the left preserves the footnote-rule gap.
14118
+ 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)",
14099
14119
  display: "flex",
14100
- gap: 16,
14120
+ gap: "clamp(12px, 1.1vw + 8px, 20px)",
14101
14121
  alignItems: "flex-start"
14102
14122
  },
14103
14123
  children: [
@@ -14111,7 +14131,7 @@ function GhostReference({
14111
14131
  transition: { duration: 0.45, delay: 0.18, ease: [0.22, 1, 0.36, 1] },
14112
14132
  style: {
14113
14133
  flexShrink: 0,
14114
- width: 46,
14134
+ width: "clamp(40px, 4vw + 20px, 64px)",
14115
14135
  aspectRatio: `${page.width} / ${page.height}`,
14116
14136
  background: PAPER_DEEP,
14117
14137
  borderRadius: 2,
@@ -14176,7 +14196,7 @@ function GhostReference({
14176
14196
  flex: 1,
14177
14197
  minWidth: 0,
14178
14198
  fontFamily: SERIF2,
14179
- fontSize: 15.5,
14199
+ fontSize: PILL_FONT_DISPLAY,
14180
14200
  lineHeight: 1.55,
14181
14201
  color: INK2,
14182
14202
  fontFeatureSettings: "'liga' 1, 'kern' 1, 'onum' 1",
@@ -14198,7 +14218,7 @@ function GhostReference({
14198
14218
  left: -14,
14199
14219
  top: -2,
14200
14220
  color: ACCENT2,
14201
- fontSize: 22,
14221
+ fontSize: "clamp(18px, 1vw + 14px, 28px)",
14202
14222
  lineHeight: 1,
14203
14223
  fontWeight: 500
14204
14224
  // ornamental flourish anchoring the paragraph
@@ -14308,10 +14328,6 @@ var import_framer_motion12 = require("framer-motion");
14308
14328
  // src/components/TutorMode/StickyLabel.tsx
14309
14329
  var import_framer_motion11 = require("framer-motion");
14310
14330
  var import_jsx_runtime51 = require("react/jsx-runtime");
14311
- var INK3 = "#2a2420";
14312
- var PAPER3 = "#faf6ec";
14313
- var ACCENT3 = "#b04a1a";
14314
- var SERIF3 = "'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', 'EB Garamond', 'Hoefler Text', Georgia, serif";
14315
14331
  var STEM = 18;
14316
14332
  function StickyLabel({ screenAnchor, action }) {
14317
14333
  const { x, y } = screenAnchor;
@@ -14350,7 +14366,7 @@ function StickyLabel({ screenAnchor, action }) {
14350
14366
  transition: { duration: 0.35, ease: [0.22, 1, 0.36, 1] },
14351
14367
  style: {
14352
14368
  position: "absolute",
14353
- background: ACCENT3,
14369
+ background: ACCENT,
14354
14370
  transformOrigin: layout.stemOrigin,
14355
14371
  ...layout.stem
14356
14372
  }
@@ -14369,8 +14385,8 @@ function StickyLabel({ screenAnchor, action }) {
14369
14385
  width: 6,
14370
14386
  height: 6,
14371
14387
  borderRadius: "50%",
14372
- background: ACCENT3,
14373
- boxShadow: `0 0 0 2px ${PAPER3}, 0 0 0 3px rgba(176, 74, 26, 0.25)`,
14388
+ background: ACCENT,
14389
+ boxShadow: `0 0 0 2px ${PAPER}, 0 0 0 3px rgba(176, 74, 26, 0.25)`,
14374
14390
  ...layout.dot
14375
14391
  }
14376
14392
  }
@@ -14385,25 +14401,25 @@ function StickyLabel({ screenAnchor, action }) {
14385
14401
  style: {
14386
14402
  position: "absolute",
14387
14403
  ...layout.bodyAnchor,
14388
- background: PAPER3,
14389
- color: INK3,
14404
+ background: PAPER,
14405
+ color: INK,
14390
14406
  border: "1px solid rgba(42, 36, 32, 0.10)",
14391
14407
  borderRadius: 3,
14392
14408
  padding: "6px 12px 6px 14px",
14393
- fontFamily: SERIF3,
14394
- fontSize: 12.5,
14409
+ fontFamily: SERIF,
14410
+ fontSize: PILL_FONT_BODY,
14395
14411
  lineHeight: 1.25,
14396
14412
  letterSpacing: 0.6,
14397
14413
  textTransform: "uppercase",
14398
14414
  fontWeight: 500,
14399
14415
  whiteSpace: "nowrap",
14400
- maxWidth: 240,
14416
+ maxWidth: PILL_MAX_W_BODY,
14401
14417
  overflow: "hidden",
14402
14418
  textOverflow: "ellipsis",
14403
14419
  // Warm two-layer shadow (matches GhostReference's palette).
14404
14420
  boxShadow: "0 1px 2px rgba(42, 36, 32, 0.12), 0 8px 18px -6px rgba(42, 36, 32, 0.22)",
14405
14421
  // Internal left accent rule — a 2px terracotta stripe.
14406
- backgroundImage: `linear-gradient(to right, ${ACCENT3} 0, ${ACCENT3} 2px, transparent 2px)`,
14422
+ backgroundImage: `linear-gradient(to right, ${ACCENT} 0, ${ACCENT} 2px, transparent 2px)`,
14407
14423
  backgroundRepeat: "no-repeat",
14408
14424
  backgroundSize: "2px 100%",
14409
14425
  backgroundPosition: "left top"
@@ -14645,9 +14661,9 @@ function computePillAnchor(fromBbox, toBbox, page, camera, viewport) {
14645
14661
  const tipScreenX = viewport.width / 2 + camera.x + (toX - pageCX) * camera.scale;
14646
14662
  const tipScreenY = viewport.height / 2 + camera.y + (toY - pageCY) * camera.scale;
14647
14663
  const isVertical = Math.abs(dy) >= Math.abs(dx);
14648
- const OFFSET = 32;
14649
- const MAX_PILL_W = 220;
14650
- const MAX_PILL_H = 30;
14664
+ const OFFSET = resolvePillOffset(viewport.width);
14665
+ const MAX_PILL_W = resolveMaxPillW(viewport.width);
14666
+ const MAX_PILL_H = resolveMaxPillH(viewport.width);
14651
14667
  const SAFE = 16;
14652
14668
  if (isVertical) {
14653
14669
  const canFitRight = tipScreenX + OFFSET + MAX_PILL_W < viewport.width - SAFE;
@@ -14691,13 +14707,13 @@ function CalloutLabelPill({
14691
14707
  borderRadius: 3,
14692
14708
  padding: spec.padding,
14693
14709
  fontFamily: SERIF,
14694
- fontSize: 11.5,
14710
+ fontSize: PILL_FONT_CAPS,
14695
14711
  lineHeight: 1.2,
14696
14712
  letterSpacing: 0.6,
14697
14713
  textTransform: "uppercase",
14698
14714
  fontWeight: 500,
14699
14715
  whiteSpace: "nowrap",
14700
- maxWidth: 220,
14716
+ maxWidth: PILL_MAX_W_CAPS,
14701
14717
  overflow: "hidden",
14702
14718
  textOverflow: "ellipsis",
14703
14719
  boxShadow: "0 1px 2px rgba(42, 36, 32, 0.12), 0 8px 18px -6px rgba(42, 36, 32, 0.22)",
@@ -15587,32 +15603,32 @@ function clampNumericRanges(input) {
15587
15603
  }
15588
15604
  const type = typeof out.type === "string" ? out.type : void 0;
15589
15605
  if (type === "camera") {
15590
- if (typeof out.scale === "number") out.scale = clamp(out.scale, 0.5, 4);
15606
+ if (typeof out.scale === "number") out.scale = clamp2(out.scale, 0.5, 4);
15591
15607
  if (typeof out.padding === "number") {
15592
- out.padding = clamp(out.padding, 0, 400);
15608
+ out.padding = clamp2(out.padding, 0, 400);
15593
15609
  }
15594
15610
  }
15595
15611
  if (typeof out.dim_opacity === "number") {
15596
- out.dim_opacity = clamp(out.dim_opacity, 0, 1);
15612
+ out.dim_opacity = clamp2(out.dim_opacity, 0, 1);
15597
15613
  }
15598
15614
  if (typeof out.feather_px === "number") {
15599
- out.feather_px = clamp(out.feather_px, 0, 200);
15615
+ out.feather_px = clamp2(out.feather_px, 0, 200);
15600
15616
  }
15601
15617
  if (typeof out.draw_duration_ms === "number") {
15602
- out.draw_duration_ms = clamp(out.draw_duration_ms, 100, 3e3);
15618
+ out.draw_duration_ms = clamp2(out.draw_duration_ms, 100, 3e3);
15603
15619
  }
15604
15620
  if (typeof out.count === "number") {
15605
- out.count = Math.round(clamp(out.count, 1, 5));
15621
+ out.count = Math.round(clamp2(out.count, 1, 5));
15606
15622
  }
15607
15623
  if (typeof out.at_ms === "number") {
15608
- out.at_ms = clamp(out.at_ms, 0, 5e3);
15624
+ out.at_ms = clamp2(out.at_ms, 0, 5e3);
15609
15625
  }
15610
15626
  if (typeof out.duration_ms === "number" && type === void 0) {
15611
- out.duration_ms = clamp(out.duration_ms, 100, 5e3);
15627
+ out.duration_ms = clamp2(out.duration_ms, 100, 5e3);
15612
15628
  }
15613
15629
  return out;
15614
15630
  }
15615
- function clamp(v, lo, hi) {
15631
+ function clamp2(v, lo, hi) {
15616
15632
  return Math.min(hi, Math.max(lo, v));
15617
15633
  }
15618
15634
  function enforceOverlayPresence(sb) {