@papyrus-sdk/ui-react-native 0.2.35-beta.6 → 0.2.35-beta.7

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 CHANGED
@@ -26281,6 +26281,29 @@ var STRINGS = {
26281
26281
  };
26282
26282
  var getStrings = (locale) => STRINGS[locale ?? "en"] ?? STRINGS.en;
26283
26283
 
26284
+ // components/nativeInkSession.ts
26285
+ function isNativeIosPencilKitViewer(platform, version, nativePdfViewerActive) {
26286
+ return platform === "ios" && Number.parseInt(String(version), 10) >= 16 && nativePdfViewerActive;
26287
+ }
26288
+ function finishNativeInkSession(setDocumentState) {
26289
+ setDocumentState({
26290
+ activeTool: "select",
26291
+ interactionMode: "pan",
26292
+ nativeInkToolPickerActive: false,
26293
+ toolDockOpen: false,
26294
+ activeMobileDestination: "none",
26295
+ mobileChromeVisible: true
26296
+ });
26297
+ }
26298
+ function handleNativeInkPickerVisibility(visible, state) {
26299
+ if (visible && (state.activeTool !== "ink" || !state.nativePdfViewerActive)) return;
26300
+ if (!visible && state.activeTool === "ink" && state.nativePdfViewerActive) {
26301
+ finishNativeInkSession(state.setDocumentState);
26302
+ return;
26303
+ }
26304
+ state.setDocumentState({ nativeInkToolPickerActive: visible });
26305
+ }
26306
+
26284
26307
  // components/annotationDeletion.ts
26285
26308
  var MARKUP_ANNOTATION_TYPES = /* @__PURE__ */ new Set([
26286
26309
  "highlight",
@@ -26483,19 +26506,12 @@ function DedicatedIosPdfViewer({
26483
26506
  );
26484
26507
  const handleInkToolPickerVisibilityChange = (0, import_react5.useCallback)(
26485
26508
  (event) => {
26486
- const visible = event.nativeEvent?.visible === true;
26487
- if (!visible && activeTool === "ink") {
26488
- setDocumentState({
26489
- activeTool: "select",
26490
- interactionMode: "pan",
26491
- nativeInkToolPickerActive: false,
26492
- toolDockOpen: false
26493
- });
26494
- return;
26495
- }
26496
- setDocumentState({ nativeInkToolPickerActive: visible });
26509
+ handleNativeInkPickerVisibility(
26510
+ event.nativeEvent?.visible === true,
26511
+ import_core4.useViewerStore.getState()
26512
+ );
26497
26513
  },
26498
- [activeTool, setDocumentState]
26514
+ []
26499
26515
  );
26500
26516
  const trackMobileChromeByOffset = (0, import_react5.useCallback)(
26501
26517
  (offsetY) => {
@@ -29285,13 +29301,54 @@ var styles7 = import_react_native8.StyleSheet.create({
29285
29301
  var Viewer_default = Viewer;
29286
29302
 
29287
29303
  // components/Topbar.tsx
29288
- var import_react12 = require("react");
29289
- var import_react_native11 = require("react-native");
29304
+ var import_react13 = require("react");
29305
+ var import_react_native12 = require("react-native");
29306
+ var import_core9 = require("@papyrus-sdk/core");
29307
+ var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
29308
+
29309
+ // components/useNativeInkChrome.ts
29310
+ var import_react10 = require("react");
29311
+ var import_react_native9 = require("react-native");
29290
29312
  var import_core8 = require("@papyrus-sdk/core");
29313
+ var import_react_native_reanimated = require("react-native-reanimated");
29314
+ function useNativeInkSession() {
29315
+ const nativePdfViewerActive = (0, import_core8.useViewerStore)((state) => state.nativePdfViewerActive);
29316
+ const activeTool = (0, import_core8.useViewerStore)((state) => state.activeTool);
29317
+ const supported = isNativeIosPencilKitViewer(import_react_native9.Platform.OS, import_react_native9.Platform.Version, nativePdfViewerActive);
29318
+ const finish = (0, import_react10.useCallback)(() => {
29319
+ finishNativeInkSession(import_core8.useViewerStore.getState().setDocumentState);
29320
+ }, []);
29321
+ return { supported, active: supported && activeTool === "ink", finish };
29322
+ }
29323
+ function useNativeInkMotion(visible, enabled) {
29324
+ const systemReducedMotion = (0, import_react_native_reanimated.useReducedMotion)();
29325
+ const [reducedMotion, setReducedMotion] = (0, import_react10.useState)(systemReducedMotion);
29326
+ const progress = (0, import_react_native_reanimated.useSharedValue)(visible ? 1 : 0);
29327
+ (0, import_react10.useEffect)(() => {
29328
+ let mounted = true;
29329
+ const subscription = import_react_native9.AccessibilityInfo.addEventListener("reduceMotionChanged", setReducedMotion);
29330
+ import_react_native9.AccessibilityInfo.isReduceMotionEnabled().then((value) => {
29331
+ if (mounted) setReducedMotion(value);
29332
+ });
29333
+ return () => {
29334
+ mounted = false;
29335
+ subscription.remove();
29336
+ };
29337
+ }, []);
29338
+ (0, import_react10.useEffect)(() => {
29339
+ progress.value = enabled ? (0, import_react_native_reanimated.withTiming)(visible ? 1 : 0, {
29340
+ duration: reducedMotion ? 0 : 220,
29341
+ easing: import_react_native_reanimated.Easing.out(import_react_native_reanimated.Easing.cubic),
29342
+ reduceMotion: import_react_native_reanimated.ReduceMotion.System
29343
+ }) : visible ? 1 : 0;
29344
+ }, [enabled, progress, reducedMotion, visible]);
29345
+ (0, import_react10.useEffect)(() => () => (0, import_react_native_reanimated.cancelAnimation)(progress), [progress]);
29346
+ return progress;
29347
+ }
29291
29348
 
29292
29349
  // components/PageJumpModal.tsx
29293
- var import_react11 = require("react");
29294
- var import_react_native10 = require("react-native");
29350
+ var import_react12 = require("react");
29351
+ var import_react_native11 = require("react-native");
29295
29352
 
29296
29353
  // components/pageJumpModel.ts
29297
29354
  var resolvePageJumpTarget = (value, pageCount) => {
@@ -29302,8 +29359,8 @@ var resolvePageJumpTarget = (value, pageCount) => {
29302
29359
  };
29303
29360
 
29304
29361
  // components/NativeSheet.tsx
29305
- var import_react10 = __toESM(require("react"));
29306
- var import_react_native9 = require("react-native");
29362
+ var import_react11 = __toESM(require("react"));
29363
+ var import_react_native10 = require("react-native");
29307
29364
 
29308
29365
  // components/nativeSheetLayout.ts
29309
29366
  var FLOATING_SHEET_MIN_WINDOW_WIDTH = 600;
@@ -29398,13 +29455,13 @@ function NativeSheet({
29398
29455
  }) {
29399
29456
  const insets = usePapyrusSafeAreaInsets();
29400
29457
  const palette = getNativeSheetPalette(Boolean(isDark));
29401
- const { height: windowHeight, width: windowWidth } = (0, import_react_native9.useWindowDimensions)();
29458
+ const { height: windowHeight, width: windowWidth } = (0, import_react_native10.useWindowDimensions)();
29402
29459
  const tabletLayout = getNativeSheetLayoutStyles(windowWidth);
29403
- const [rendered, setRendered] = (0, import_react10.useState)(visible);
29404
- const renderedRef = (0, import_react10.useRef)(visible);
29405
- const motion = (0, import_react10.useRef)(new import_react_native9.Animated.Value(visible ? 0 : 1)).current;
29406
- const backdropOpacity = (0, import_react10.useRef)(new import_react_native9.Animated.Value(visible ? 1 : 0)).current;
29407
- (0, import_react10.useEffect)(() => {
29460
+ const [rendered, setRendered] = (0, import_react11.useState)(visible);
29461
+ const renderedRef = (0, import_react11.useRef)(visible);
29462
+ const motion = (0, import_react11.useRef)(new import_react_native10.Animated.Value(visible ? 0 : 1)).current;
29463
+ const backdropOpacity = (0, import_react11.useRef)(new import_react_native10.Animated.Value(visible ? 1 : 0)).current;
29464
+ (0, import_react11.useEffect)(() => {
29408
29465
  motion.stopAnimation();
29409
29466
  backdropOpacity.stopAnimation();
29410
29467
  if (visible) {
@@ -29412,15 +29469,15 @@ function NativeSheet({
29412
29469
  setRendered(true);
29413
29470
  motion.setValue(1);
29414
29471
  backdropOpacity.setValue(0);
29415
- import_react_native9.Animated.parallel([
29416
- import_react_native9.Animated.spring(motion, {
29472
+ import_react_native10.Animated.parallel([
29473
+ import_react_native10.Animated.spring(motion, {
29417
29474
  toValue: 0,
29418
29475
  damping: 22,
29419
29476
  stiffness: 220,
29420
29477
  mass: 0.8,
29421
29478
  useNativeDriver: true
29422
29479
  }),
29423
- import_react_native9.Animated.timing(backdropOpacity, {
29480
+ import_react_native10.Animated.timing(backdropOpacity, {
29424
29481
  toValue: 1,
29425
29482
  duration: 180,
29426
29483
  useNativeDriver: true
@@ -29429,13 +29486,13 @@ function NativeSheet({
29429
29486
  return;
29430
29487
  }
29431
29488
  if (!renderedRef.current) return;
29432
- import_react_native9.Animated.parallel([
29433
- import_react_native9.Animated.timing(motion, {
29489
+ import_react_native10.Animated.parallel([
29490
+ import_react_native10.Animated.timing(motion, {
29434
29491
  toValue: 1,
29435
29492
  duration: 180,
29436
29493
  useNativeDriver: true
29437
29494
  }),
29438
- import_react_native9.Animated.timing(backdropOpacity, {
29495
+ import_react_native10.Animated.timing(backdropOpacity, {
29439
29496
  toValue: 0,
29440
29497
  duration: 140,
29441
29498
  useNativeDriver: true
@@ -29448,24 +29505,24 @@ function NativeSheet({
29448
29505
  }, [backdropOpacity, motion, visible]);
29449
29506
  if (!rendered) return null;
29450
29507
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
29451
- import_react_native9.Modal,
29508
+ import_react_native10.Modal,
29452
29509
  {
29453
29510
  animationType: "none",
29454
29511
  transparent: true,
29455
29512
  visible: rendered,
29456
29513
  onRequestClose: onClose,
29457
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native9.View, { style: [styles8.root, tabletLayout?.root], children: [
29458
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native9.Animated.View, { style: [styles8.backdrop, { opacity: backdropOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
29459
- import_react_native9.Pressable,
29514
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native10.View, { style: [styles8.root, tabletLayout?.root], children: [
29515
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native10.Animated.View, { style: [styles8.backdrop, { opacity: backdropOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
29516
+ import_react_native10.Pressable,
29460
29517
  {
29461
29518
  accessibilityRole: "button",
29462
29519
  accessibilityLabel: closeAccessibilityLabel,
29463
- style: import_react_native9.StyleSheet.absoluteFill,
29520
+ style: import_react_native10.StyleSheet.absoluteFill,
29464
29521
  onPress: onClose
29465
29522
  }
29466
29523
  ) }),
29467
29524
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
29468
- import_react_native9.Animated.View,
29525
+ import_react_native10.Animated.View,
29469
29526
  {
29470
29527
  style: [
29471
29528
  styles8.sheet,
@@ -29491,10 +29548,10 @@ function NativeSheet({
29491
29548
  }
29492
29549
  ],
29493
29550
  children: [
29494
- showHeader ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native9.View, { style: styles8.header, children: [
29495
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native9.View, { style: styles8.headerSpacer }),
29551
+ showHeader ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native10.View, { style: styles8.header, children: [
29552
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native10.View, { style: styles8.headerSpacer }),
29496
29553
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
29497
- import_react_native9.Text,
29554
+ import_react_native10.Text,
29498
29555
  {
29499
29556
  style: [styles8.title, { color: palette.textColor }],
29500
29557
  numberOfLines: 1,
@@ -29502,7 +29559,7 @@ function NativeSheet({
29502
29559
  }
29503
29560
  ),
29504
29561
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
29505
- import_react_native9.Pressable,
29562
+ import_react_native10.Pressable,
29506
29563
  {
29507
29564
  onPress: onClose,
29508
29565
  style: [
@@ -29523,20 +29580,20 @@ function NativeSheet({
29523
29580
  }
29524
29581
  );
29525
29582
  }
29526
- var NativeSheetScrollView = import_react10.default.forwardRef(function NativeSheetScrollView2(props, ref) {
29527
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native9.ScrollView, { ref, ...props });
29583
+ var NativeSheetScrollView = import_react11.default.forwardRef(function NativeSheetScrollView2(props, ref) {
29584
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native10.ScrollView, { ref, ...props });
29528
29585
  });
29529
29586
  function NativeSheetFlatList(props) {
29530
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native9.FlatList, { ...props });
29587
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native10.FlatList, { ...props });
29531
29588
  }
29532
- var styles8 = import_react_native9.StyleSheet.create({
29589
+ var styles8 = import_react_native10.StyleSheet.create({
29533
29590
  root: {
29534
29591
  flex: 1,
29535
29592
  justifyContent: "flex-end",
29536
29593
  alignItems: "center"
29537
29594
  },
29538
29595
  backdrop: {
29539
- ...import_react_native9.StyleSheet.absoluteFillObject,
29596
+ ...import_react_native10.StyleSheet.absoluteFillObject,
29540
29597
  backgroundColor: "rgba(0, 0, 0, 0.4)"
29541
29598
  },
29542
29599
  sheet: {
@@ -29598,9 +29655,9 @@ function PageJumpModal({
29598
29655
  onClose,
29599
29656
  onConfirm
29600
29657
  }) {
29601
- const [value, setValue] = (0, import_react11.useState)(`${currentPage}`);
29658
+ const [value, setValue] = (0, import_react12.useState)(`${currentPage}`);
29602
29659
  const palette = getReaderSheetPalette(isDark);
29603
- (0, import_react11.useEffect)(() => {
29660
+ (0, import_react12.useEffect)(() => {
29604
29661
  if (visible) setValue(`${currentPage}`);
29605
29662
  }, [currentPage, visible]);
29606
29663
  const confirmJump = () => {
@@ -29626,7 +29683,7 @@ function PageJumpModal({
29626
29683
  },
29627
29684
  children: [
29628
29685
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
29629
- import_react_native10.TextInput,
29686
+ import_react_native11.TextInput,
29630
29687
  {
29631
29688
  value,
29632
29689
  onChangeText: (text) => setValue(text.replace(/[^0-9]/g, "")),
@@ -29649,25 +29706,25 @@ function PageJumpModal({
29649
29706
  testID: "papyrus-page-jump-input"
29650
29707
  }
29651
29708
  ),
29652
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native10.View, { style: styles9.actions, children: [
29709
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native11.View, { style: styles9.actions, children: [
29653
29710
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
29654
- import_react_native10.Pressable,
29711
+ import_react_native11.Pressable,
29655
29712
  {
29656
29713
  onPress: onClose,
29657
29714
  style: [
29658
29715
  styles9.actionButton,
29659
29716
  { backgroundColor: palette.closeSurface }
29660
29717
  ],
29661
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native10.Text, { style: [styles9.actionText, { color: palette.text }], children: "Cancelar" })
29718
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native11.Text, { style: [styles9.actionText, { color: palette.text }], children: "Cancelar" })
29662
29719
  }
29663
29720
  ),
29664
29721
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
29665
- import_react_native10.Pressable,
29722
+ import_react_native11.Pressable,
29666
29723
  {
29667
29724
  onPress: confirmJump,
29668
29725
  style: [styles9.actionButton, { backgroundColor: accentColor }],
29669
29726
  testID: "papyrus-page-jump-confirm",
29670
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native10.Text, { style: [styles9.actionText, styles9.actionTextPrimary], children: "Ir" })
29727
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native11.Text, { style: [styles9.actionText, styles9.actionTextPrimary], children: "Ir" })
29671
29728
  }
29672
29729
  )
29673
29730
  ] })
@@ -29675,7 +29732,7 @@ function PageJumpModal({
29675
29732
  }
29676
29733
  );
29677
29734
  }
29678
- var styles9 = import_react_native10.StyleSheet.create({
29735
+ var styles9 = import_react_native11.StyleSheet.create({
29679
29736
  input: {
29680
29737
  borderRadius: 14,
29681
29738
  borderWidth: 1,
@@ -29716,12 +29773,24 @@ var Topbar = ({
29716
29773
  setDocumentState,
29717
29774
  triggerScrollToPage,
29718
29775
  accentColor,
29719
- mobileChromeVisible
29720
- } = (0, import_core8.useViewerStore)();
29721
- const [jumpModalOpen, setJumpModalOpen] = (0, import_react12.useState)(false);
29776
+ mobileChromeVisible,
29777
+ locale
29778
+ } = (0, import_core9.useViewerStore)();
29779
+ const inkSession = useNativeInkSession();
29780
+ const t = getStrings(locale);
29781
+ const progress = useNativeInkMotion(inkSession.active, inkSession.supported);
29782
+ const settingsMotion = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
29783
+ opacity: 1 - progress.value,
29784
+ transform: [{ scale: 1 - progress.value * 0.04 }, { translateX: -progress.value * 6 }]
29785
+ }));
29786
+ const doneMotion = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
29787
+ opacity: progress.value,
29788
+ transform: [{ scale: 0.96 + progress.value * 0.04 }, { translateX: (1 - progress.value) * 6 }]
29789
+ }));
29790
+ const [jumpModalOpen, setJumpModalOpen] = (0, import_react13.useState)(false);
29722
29791
  const isDark = uiTheme === "dark";
29723
29792
  const navIconColor = isDark ? "#e5e7eb" : "#111827";
29724
- const { width, height } = (0, import_react_native11.useWindowDimensions)();
29793
+ const { width, height } = (0, import_react_native12.useWindowDimensions)();
29725
29794
  const isLandscape = width > height;
29726
29795
  const insets = usePapyrusSafeAreaInsets();
29727
29796
  const navigateToPage = (targetPage) => {
@@ -29740,12 +29809,27 @@ var Topbar = ({
29740
29809
  }
29741
29810
  setJumpModalOpen(true);
29742
29811
  };
29743
- const defaultLogo = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native11.View, { style: [styles10.logoBadge, { backgroundColor: accentColor }], children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native11.Text, { style: styles10.logoText, children: "P" }) });
29812
+ const defaultLogo = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: [styles10.logoBadge, { backgroundColor: accentColor }], children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.Text, { style: styles10.logoText, children: "P" }) });
29744
29813
  const logoElement = logo ?? defaultLogo;
29745
- if (!mobileChromeVisible) return null;
29814
+ const settingsControl = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29815
+ import_react_native12.Pressable,
29816
+ {
29817
+ onPress: () => onOpenOverflow?.() ?? onOpenSettings?.(),
29818
+ style: [
29819
+ styles10.iconButton,
29820
+ isDark && styles10.iconButtonDark,
29821
+ inkSession.supported && styles10.annotationSettingsButton
29822
+ ],
29823
+ accessibilityRole: "button",
29824
+ accessibilityLabel: "Open overflow menu",
29825
+ disabled: inkSession.active,
29826
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconSettings, { size: MOBILE_CHROME_METRICS.iconSize, color: isDark ? "#e5e7eb" : "#111827" })
29827
+ }
29828
+ );
29829
+ if (!mobileChromeVisible && !inkSession.active) return null;
29746
29830
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
29747
29831
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29748
- import_react_native11.View,
29832
+ import_react_native12.View,
29749
29833
  {
29750
29834
  style: [
29751
29835
  styles10.chromeFrame,
@@ -29758,7 +29842,7 @@ var Topbar = ({
29758
29842
  pointerEvents: "box-none",
29759
29843
  testID: "papyrus-floating-top-controls",
29760
29844
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
29761
- import_react_native11.View,
29845
+ import_react_native12.View,
29762
29846
  {
29763
29847
  style: [
29764
29848
  styles10.container,
@@ -29766,26 +29850,29 @@ var Topbar = ({
29766
29850
  isLandscape && styles10.containerLandscape
29767
29851
  ],
29768
29852
  children: [
29769
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native11.View, { style: styles10.leftGroup, children: [
29853
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: styles10.leftGroup, children: [
29770
29854
  onLogoPress ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29771
- import_react_native11.Pressable,
29855
+ import_react_native12.Pressable,
29772
29856
  {
29773
- onPress: onLogoPress,
29857
+ onPress: () => {
29858
+ if (inkSession.active) inkSession.finish();
29859
+ else onLogoPress();
29860
+ },
29774
29861
  accessibilityRole: "button",
29775
29862
  accessibilityLabel: logoAccessibilityLabel,
29776
29863
  style: styles10.logoSlot,
29777
29864
  children: logoElement
29778
29865
  }
29779
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native11.View, { style: styles10.logoSlot, children: logoElement }),
29866
+ ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: styles10.logoSlot, children: logoElement }),
29780
29867
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29781
- import_react_native11.Pressable,
29868
+ import_react_native12.Pressable,
29782
29869
  {
29783
29870
  onPress: openJumpModal,
29784
29871
  disabled: pageCount <= 0,
29785
29872
  style: styles10.titleHit,
29786
29873
  accessibilityLabel: "Open page jump",
29787
29874
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29788
- import_react_native11.Text,
29875
+ import_react_native12.Text,
29789
29876
  {
29790
29877
  numberOfLines: 1,
29791
29878
  style: [styles10.brandText, isDark && styles10.brandTextDark],
@@ -29795,9 +29882,9 @@ var Topbar = ({
29795
29882
  }
29796
29883
  )
29797
29884
  ] }),
29798
- showPageNavigationControls ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native11.View, { style: styles10.pageGroup, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
29885
+ showPageNavigationControls ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: styles10.pageGroup, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
29799
29886
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29800
- import_react_native11.Pressable,
29887
+ import_react_native12.Pressable,
29801
29888
  {
29802
29889
  onPress: () => handlePageChange(-1),
29803
29890
  style: [styles10.pageButton, isDark && styles10.pageButtonDark],
@@ -29811,13 +29898,13 @@ var Topbar = ({
29811
29898
  }
29812
29899
  ),
29813
29900
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29814
- import_react_native11.Pressable,
29901
+ import_react_native12.Pressable,
29815
29902
  {
29816
29903
  onPress: openJumpModal,
29817
29904
  style: styles10.pageIndicatorHit,
29818
29905
  accessibilityLabel: "Page jump",
29819
29906
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
29820
- import_react_native11.Text,
29907
+ import_react_native12.Text,
29821
29908
  {
29822
29909
  style: [
29823
29910
  styles10.pageIndicator,
@@ -29833,7 +29920,7 @@ var Topbar = ({
29833
29920
  }
29834
29921
  ),
29835
29922
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29836
- import_react_native11.Pressable,
29923
+ import_react_native12.Pressable,
29837
29924
  {
29838
29925
  onPress: () => handlePageChange(1),
29839
29926
  style: [styles10.pageButton, isDark && styles10.pageButtonDark],
@@ -29847,21 +29934,49 @@ var Topbar = ({
29847
29934
  }
29848
29935
  )
29849
29936
  ] }) }) : null,
29850
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native11.View, { style: styles10.rightGroup, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29851
- import_react_native11.Pressable,
29937
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29938
+ import_react_native12.View,
29852
29939
  {
29853
- onPress: () => onOpenOverflow?.() ?? onOpenSettings?.(),
29854
- style: [styles10.iconButton, isDark && styles10.iconButtonDark],
29855
- accessibilityLabel: "Open overflow menu",
29856
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29857
- IconSettings,
29858
- {
29859
- size: MOBILE_CHROME_METRICS.iconSize,
29860
- color: isDark ? "#e5e7eb" : "#111827"
29861
- }
29862
- )
29940
+ style: [styles10.rightGroup, inkSession.supported && styles10.annotationActionSlot],
29941
+ testID: "papyrus-topbar-action-slot",
29942
+ children: inkSession.supported ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
29943
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29944
+ import_react_native_reanimated2.default.View,
29945
+ {
29946
+ style: [styles10.settingsSlot, settingsMotion],
29947
+ pointerEvents: inkSession.active ? "none" : "auto",
29948
+ accessibilityElementsHidden: inkSession.active,
29949
+ importantForAccessibility: inkSession.active ? "no-hide-descendants" : "auto",
29950
+ children: settingsControl
29951
+ }
29952
+ ),
29953
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29954
+ import_react_native_reanimated2.default.View,
29955
+ {
29956
+ style: [styles10.doneSlot, doneMotion],
29957
+ pointerEvents: inkSession.active ? "auto" : "none",
29958
+ accessibilityElementsHidden: !inkSession.active,
29959
+ importantForAccessibility: inkSession.active ? "auto" : "no-hide-descendants",
29960
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29961
+ import_react_native12.Pressable,
29962
+ {
29963
+ onPress: inkSession.finish,
29964
+ disabled: !inkSession.active,
29965
+ style: styles10.doneButton,
29966
+ accessibilityRole: "button",
29967
+ accessibilityLabel: t.done,
29968
+ testID: "papyrus-topbar-ink-done",
29969
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.Text, { style: styles10.doneButtonText, children: [
29970
+ "\u2713 ",
29971
+ t.done
29972
+ ] })
29973
+ }
29974
+ )
29975
+ }
29976
+ )
29977
+ ] }) : settingsControl
29863
29978
  }
29864
- ) })
29979
+ )
29865
29980
  ]
29866
29981
  }
29867
29982
  )
@@ -29881,7 +29996,7 @@ var Topbar = ({
29881
29996
  )
29882
29997
  ] });
29883
29998
  };
29884
- var styles10 = import_react_native11.StyleSheet.create({
29999
+ var styles10 = import_react_native12.StyleSheet.create({
29885
30000
  container: {
29886
30001
  width: "100%",
29887
30002
  maxWidth: MOBILE_CHROME_METRICS.maxFloatingWidth,
@@ -30007,6 +30122,42 @@ var styles10 = import_react_native11.StyleSheet.create({
30007
30122
  flexShrink: 0,
30008
30123
  marginLeft: 12
30009
30124
  },
30125
+ annotationActionSlot: {
30126
+ width: 108,
30127
+ height: 44
30128
+ },
30129
+ settingsSlot: {
30130
+ position: "absolute",
30131
+ right: 0,
30132
+ top: 0
30133
+ },
30134
+ annotationSettingsButton: {
30135
+ minWidth: 44,
30136
+ minHeight: 44,
30137
+ marginLeft: 0,
30138
+ justifyContent: "center",
30139
+ alignItems: "center"
30140
+ },
30141
+ doneSlot: {
30142
+ position: "absolute",
30143
+ left: 0,
30144
+ right: 0,
30145
+ top: 0
30146
+ },
30147
+ doneButton: {
30148
+ minWidth: 44,
30149
+ minHeight: 44,
30150
+ paddingHorizontal: 10,
30151
+ borderRadius: 12,
30152
+ backgroundColor: "#2563eb",
30153
+ alignItems: "center",
30154
+ justifyContent: "center"
30155
+ },
30156
+ doneButtonText: {
30157
+ color: "#fff",
30158
+ fontSize: 14,
30159
+ fontWeight: "700"
30160
+ },
30010
30161
  iconButton: {
30011
30162
  paddingHorizontal: 10,
30012
30163
  paddingVertical: 6,
@@ -30042,9 +30193,9 @@ var styles10 = import_react_native11.StyleSheet.create({
30042
30193
  var Topbar_default = Topbar;
30043
30194
 
30044
30195
  // components/ToolDock.tsx
30045
- var import_react13 = __toESM(require("react"));
30046
- var import_react_native12 = require("react-native");
30047
- var import_core9 = require("@papyrus-sdk/core");
30196
+ var import_react14 = __toESM(require("react"));
30197
+ var import_react_native13 = require("react-native");
30198
+ var import_core10 = require("@papyrus-sdk/core");
30048
30199
 
30049
30200
  // components/ToolDock.layout.ts
30050
30201
  var TOOL_DOCK_SCROLL_THRESHOLD = 420;
@@ -30143,24 +30294,24 @@ var getToolVisual = (toolId) => {
30143
30294
  return { width: 24, iconSize: 28, offsetY: 6 };
30144
30295
  }
30145
30296
  };
30146
- var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30297
+ var OpacitySlider = import_react14.default.memo(function OpacitySlider2({
30147
30298
  value,
30148
30299
  color,
30149
30300
  isDark,
30150
30301
  onCommit
30151
30302
  }) {
30152
- const [trackWidth, setTrackWidth] = (0, import_react13.useState)(0);
30153
- const [draftValue, setDraftValue] = (0, import_react13.useState)(value);
30154
- const dragValueRef = (0, import_react13.useRef)(draftValue);
30155
- const isDraggingRef = (0, import_react13.useRef)(false);
30156
- const frameRef = (0, import_react13.useRef)(null);
30157
- (0, import_react13.useEffect)(() => {
30303
+ const [trackWidth, setTrackWidth] = (0, import_react14.useState)(0);
30304
+ const [draftValue, setDraftValue] = (0, import_react14.useState)(value);
30305
+ const dragValueRef = (0, import_react14.useRef)(draftValue);
30306
+ const isDraggingRef = (0, import_react14.useRef)(false);
30307
+ const frameRef = (0, import_react14.useRef)(null);
30308
+ (0, import_react14.useEffect)(() => {
30158
30309
  if (!isDraggingRef.current) {
30159
30310
  dragValueRef.current = value;
30160
30311
  setDraftValue(value);
30161
30312
  }
30162
30313
  }, [value]);
30163
- (0, import_react13.useEffect)(() => {
30314
+ (0, import_react14.useEffect)(() => {
30164
30315
  return () => {
30165
30316
  if (frameRef.current !== null) {
30166
30317
  cancelAnimationFrame(frameRef.current);
@@ -30197,8 +30348,8 @@ var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30197
30348
  setDraftValue(next);
30198
30349
  onCommit(next);
30199
30350
  };
30200
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.opacitySliderWrap, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
30201
- import_react_native12.View,
30351
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.opacitySliderWrap, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
30352
+ import_react_native13.View,
30202
30353
  {
30203
30354
  style: styles11.opacityTouchSurface,
30204
30355
  onLayout: (event) => setTrackWidth(event.nativeEvent.layout.width),
@@ -30209,9 +30360,9 @@ var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30209
30360
  onResponderRelease: commitDraft,
30210
30361
  onResponderTerminate: () => commitDraft(),
30211
30362
  children: [
30212
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.opacityTrack }),
30363
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.opacityTrack }),
30213
30364
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30214
- import_react_native12.View,
30365
+ import_react_native13.View,
30215
30366
  {
30216
30367
  style: [
30217
30368
  styles11.opacityTrackFill,
@@ -30223,7 +30374,7 @@ var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30223
30374
  }
30224
30375
  ),
30225
30376
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30226
- import_react_native12.View,
30377
+ import_react_native13.View,
30227
30378
  {
30228
30379
  style: [
30229
30380
  styles11.opacityThumb,
@@ -30260,11 +30411,11 @@ var ToolDock = () => {
30260
30411
  annotationRedoStack,
30261
30412
  undoAnnotations,
30262
30413
  redoAnnotations
30263
- } = (0, import_core9.useViewerStore)();
30264
- const [paletteExpanded, setPaletteExpanded] = (0, import_react13.useState)(false);
30265
- const [extrasExpanded, setExtrasExpanded] = (0, import_react13.useState)(false);
30414
+ } = (0, import_core10.useViewerStore)();
30415
+ const [paletteExpanded, setPaletteExpanded] = (0, import_react14.useState)(false);
30416
+ const [extrasExpanded, setExtrasExpanded] = (0, import_react14.useState)(false);
30266
30417
  const isDark = uiTheme === "dark";
30267
- const { width: windowWidth } = (0, import_react_native12.useWindowDimensions)();
30418
+ const { width: windowWidth } = (0, import_react_native13.useWindowDimensions)();
30268
30419
  const t = getStrings(locale);
30269
30420
  const panelColor = isDark ? "rgba(24,24,27,0.92)" : "rgba(255,255,255,0.96)";
30270
30421
  const borderColor = isDark ? "rgba(71,85,105,0.48)" : "rgba(229,231,235,0.88)";
@@ -30272,7 +30423,7 @@ var ToolDock = () => {
30272
30423
  const iconColor = isDark ? "#e5e7eb" : "#111827";
30273
30424
  const labelColor = isDark ? "#e5e7eb" : "#374151";
30274
30425
  const utilityIconColor = isDark ? "#f8fafc" : "#111827";
30275
- const selectedTool = (0, import_react13.useMemo)(
30426
+ const selectedTool = (0, import_react14.useMemo)(
30276
30427
  () => ALL_TOOLS.find(
30277
30428
  (tool) => tool.id === "ink" || tool.id === "highlight" || tool.id === "underline" ? activeTool === "ink" && activeDrawToolPreset === tool.id : isToolDockToolSelected({
30278
30429
  toolId: tool.id,
@@ -30289,7 +30440,7 @@ var ToolDock = () => {
30289
30440
  const canUndo = annotationUndoStack.length > 0;
30290
30441
  const canRedo = annotationRedoStack.length > 0;
30291
30442
  const primaryToolsRowIsScrollable = shouldUseScrollablePrimaryToolsRow(windowWidth);
30292
- (0, import_react13.useEffect)(() => {
30443
+ (0, import_react14.useEffect)(() => {
30293
30444
  if (!nativeInkToolPickerActive) return;
30294
30445
  setPaletteExpanded(false);
30295
30446
  setExtrasExpanded(false);
@@ -30356,7 +30507,7 @@ var ToolDock = () => {
30356
30507
  baseIconColor
30357
30508
  });
30358
30509
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30359
- import_react_native12.Pressable,
30510
+ import_react_native13.Pressable,
30360
30511
  {
30361
30512
  onPress: () => {
30362
30513
  applyTool(tool.id);
@@ -30367,7 +30518,7 @@ var ToolDock = () => {
30367
30518
  { width: compact ? void 0 : visual.width }
30368
30519
  ],
30369
30520
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30370
- import_react_native12.View,
30521
+ import_react_native13.View,
30371
30522
  {
30372
30523
  style: [
30373
30524
  compact ? styles11.compactToolIconWrap : styles11.toolIconWrap,
@@ -30393,13 +30544,13 @@ var ToolDock = () => {
30393
30544
  );
30394
30545
  };
30395
30546
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30396
- import_react_native12.View,
30547
+ import_react_native13.View,
30397
30548
  {
30398
30549
  pointerEvents: "box-none",
30399
30550
  style: [styles11.root, { paddingBottom: chromeOffsets.toolDock }],
30400
- children: toolDockOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.stack, children: [
30551
+ children: toolDockOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.stack, children: [
30401
30552
  paletteExpanded && showInkDockControls ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30402
- import_react_native12.View,
30553
+ import_react_native13.View,
30403
30554
  {
30404
30555
  style: [
30405
30556
  styles11.popup,
@@ -30408,10 +30559,10 @@ var ToolDock = () => {
30408
30559
  borderColor
30409
30560
  }
30410
30561
  ],
30411
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.swatchRow, children: COLOR_SWATCHES.map((color) => {
30562
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.swatchRow, children: COLOR_SWATCHES.map((color) => {
30412
30563
  const isSelected = annotationColor === color;
30413
30564
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30414
- import_react_native12.Pressable,
30565
+ import_react_native13.Pressable,
30415
30566
  {
30416
30567
  onPress: () => setAnnotationColor(color),
30417
30568
  style: [
@@ -30422,7 +30573,7 @@ var ToolDock = () => {
30422
30573
  }
30423
30574
  ],
30424
30575
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30425
- import_react_native12.View,
30576
+ import_react_native13.View,
30426
30577
  {
30427
30578
  style: [
30428
30579
  styles11.swatch,
@@ -30440,7 +30591,7 @@ var ToolDock = () => {
30440
30591
  }
30441
30592
  ) : null,
30442
30593
  inkSettingsExpanded && showInkDockControls ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
30443
- import_react_native12.View,
30594
+ import_react_native13.View,
30444
30595
  {
30445
30596
  style: [
30446
30597
  styles11.popup,
@@ -30451,10 +30602,10 @@ var ToolDock = () => {
30451
30602
  }
30452
30603
  ],
30453
30604
  children: [
30454
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.inkPreviewRow, children: INK_WIDTHS.map((width) => {
30605
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.inkPreviewRow, children: INK_WIDTHS.map((width) => {
30455
30606
  const selected = Math.abs(inkStrokeWidth - width) < 5e-4;
30456
30607
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30457
- import_react_native12.Pressable,
30608
+ import_react_native13.Pressable,
30458
30609
  {
30459
30610
  onPress: () => setInkStrokeWidth(width),
30460
30611
  style: [
@@ -30464,7 +30615,7 @@ var ToolDock = () => {
30464
30615
  borderColor: `${accentColor}30`
30465
30616
  }
30466
30617
  ],
30467
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.inkNib, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30618
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.inkNib, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30468
30619
  IconToolInk,
30469
30620
  {
30470
30621
  size: Math.round(18 + width * 1200),
@@ -30488,7 +30639,7 @@ var ToolDock = () => {
30488
30639
  }
30489
30640
  ) : null,
30490
30641
  extrasExpanded ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30491
- import_react_native12.View,
30642
+ import_react_native13.View,
30492
30643
  {
30493
30644
  style: [
30494
30645
  styles11.popup,
@@ -30498,11 +30649,11 @@ var ToolDock = () => {
30498
30649
  borderColor
30499
30650
  }
30500
30651
  ],
30501
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.compactToolsRow, children: EXTRA_TOOLS.map((tool) => renderToolButton(tool, true)) })
30652
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.compactToolsRow, children: EXTRA_TOOLS.map((tool) => renderToolButton(tool, true)) })
30502
30653
  }
30503
30654
  ) : null,
30504
30655
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30505
- import_react_native12.View,
30656
+ import_react_native13.View,
30506
30657
  {
30507
30658
  style: [
30508
30659
  styles11.container,
@@ -30512,7 +30663,7 @@ var ToolDock = () => {
30512
30663
  }
30513
30664
  ],
30514
30665
  children: primaryToolsRowIsScrollable ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30515
- import_react_native12.ScrollView,
30666
+ import_react_native13.ScrollView,
30516
30667
  {
30517
30668
  horizontal: true,
30518
30669
  bounces: false,
@@ -30522,10 +30673,10 @@ var ToolDock = () => {
30522
30673
  styles11.primaryToolsRow,
30523
30674
  styles11.primaryToolsRowScrollableContent
30524
30675
  ],
30525
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.primaryToolsRowInner, children: [
30526
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.historyGroup, children: [
30676
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.primaryToolsRowInner, children: [
30677
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.historyGroup, children: [
30527
30678
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30528
- import_react_native12.Pressable,
30679
+ import_react_native13.Pressable,
30529
30680
  {
30530
30681
  onPress: undoAnnotations,
30531
30682
  disabled: !canUndo,
@@ -30546,7 +30697,7 @@ var ToolDock = () => {
30546
30697
  }
30547
30698
  ),
30548
30699
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30549
- import_react_native12.Pressable,
30700
+ import_react_native13.Pressable,
30550
30701
  {
30551
30702
  onPress: redoAnnotations,
30552
30703
  disabled: !canRedo,
@@ -30567,10 +30718,10 @@ var ToolDock = () => {
30567
30718
  }
30568
30719
  )
30569
30720
  ] }),
30570
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
30571
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.controlsGroup, children: [
30721
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
30722
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.controlsGroup, children: [
30572
30723
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30573
- import_react_native12.Pressable,
30724
+ import_react_native13.Pressable,
30574
30725
  {
30575
30726
  onPress: () => {
30576
30727
  setExtrasExpanded((value) => !value);
@@ -30583,7 +30734,7 @@ var ToolDock = () => {
30583
30734
  }
30584
30735
  ],
30585
30736
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30586
- import_react_native12.Text,
30737
+ import_react_native13.Text,
30587
30738
  {
30588
30739
  style: [
30589
30740
  styles11.utilityLabel,
@@ -30595,7 +30746,7 @@ var ToolDock = () => {
30595
30746
  }
30596
30747
  ),
30597
30748
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30598
- import_react_native12.Pressable,
30749
+ import_react_native13.Pressable,
30599
30750
  {
30600
30751
  onPress: () => {
30601
30752
  setPaletteExpanded((value) => !value);
@@ -30613,7 +30764,7 @@ var ToolDock = () => {
30613
30764
  }
30614
30765
  ),
30615
30766
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30616
- import_react_native12.Pressable,
30767
+ import_react_native13.Pressable,
30617
30768
  {
30618
30769
  onPress: () => setDocumentState(
30619
30770
  getToolDockDismissState({
@@ -30638,10 +30789,10 @@ var ToolDock = () => {
30638
30789
  ] })
30639
30790
  ] })
30640
30791
  }
30641
- ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.primaryToolsRow, children: [
30642
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.historyGroup, children: [
30792
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.primaryToolsRow, children: [
30793
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.historyGroup, children: [
30643
30794
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30644
- import_react_native12.Pressable,
30795
+ import_react_native13.Pressable,
30645
30796
  {
30646
30797
  onPress: undoAnnotations,
30647
30798
  disabled: !canUndo,
@@ -30662,7 +30813,7 @@ var ToolDock = () => {
30662
30813
  }
30663
30814
  ),
30664
30815
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30665
- import_react_native12.Pressable,
30816
+ import_react_native13.Pressable,
30666
30817
  {
30667
30818
  onPress: redoAnnotations,
30668
30819
  disabled: !canRedo,
@@ -30683,10 +30834,10 @@ var ToolDock = () => {
30683
30834
  }
30684
30835
  )
30685
30836
  ] }),
30686
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
30687
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.controlsGroup, children: [
30837
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
30838
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.controlsGroup, children: [
30688
30839
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30689
- import_react_native12.Pressable,
30840
+ import_react_native13.Pressable,
30690
30841
  {
30691
30842
  onPress: () => {
30692
30843
  setExtrasExpanded((value) => !value);
@@ -30699,7 +30850,7 @@ var ToolDock = () => {
30699
30850
  }
30700
30851
  ],
30701
30852
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30702
- import_react_native12.Text,
30853
+ import_react_native13.Text,
30703
30854
  {
30704
30855
  style: [
30705
30856
  styles11.utilityLabel,
@@ -30711,7 +30862,7 @@ var ToolDock = () => {
30711
30862
  }
30712
30863
  ),
30713
30864
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30714
- import_react_native12.Pressable,
30865
+ import_react_native13.Pressable,
30715
30866
  {
30716
30867
  onPress: () => {
30717
30868
  setPaletteExpanded((value) => !value);
@@ -30729,7 +30880,7 @@ var ToolDock = () => {
30729
30880
  }
30730
30881
  ),
30731
30882
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30732
- import_react_native12.Pressable,
30883
+ import_react_native13.Pressable,
30733
30884
  {
30734
30885
  onPress: () => setDocumentState(
30735
30886
  getToolDockDismissState({
@@ -30756,9 +30907,9 @@ var ToolDock = () => {
30756
30907
  }
30757
30908
  );
30758
30909
  };
30759
- var styles11 = import_react_native12.StyleSheet.create({
30910
+ var styles11 = import_react_native13.StyleSheet.create({
30760
30911
  root: {
30761
- ...import_react_native12.StyleSheet.absoluteFillObject,
30912
+ ...import_react_native13.StyleSheet.absoluteFillObject,
30762
30913
  alignItems: "center",
30763
30914
  justifyContent: "flex-end",
30764
30915
  paddingHorizontal: MOBILE_CHROME_METRICS.screenPadding,
@@ -31001,9 +31152,9 @@ var withInkAlpha = (hex, alpha) => {
31001
31152
  var ToolDock_default = ToolDock;
31002
31153
 
31003
31154
  // components/RightSheet.tsx
31004
- var import_react14 = require("react");
31005
- var import_react_native13 = require("react-native");
31006
- var import_core10 = require("@papyrus-sdk/core");
31155
+ var import_react15 = require("react");
31156
+ var import_react_native14 = require("react-native");
31157
+ var import_core11 = require("@papyrus-sdk/core");
31007
31158
  var import_engine_native7 = require("@papyrus-sdk/engine-native");
31008
31159
 
31009
31160
  // components/rightSheetLayout.ts
@@ -31068,14 +31219,14 @@ var PageThumbnail = ({
31068
31219
  shouldRenderPreview,
31069
31220
  onPress
31070
31221
  }) => {
31071
- const viewRef = (0, import_react14.useRef)(null);
31072
- const [layoutReady, setLayoutReady] = (0, import_react14.useState)(false);
31073
- const [previewUri, setPreviewUri] = (0, import_react14.useState)(null);
31074
- (0, import_react14.useEffect)(() => {
31222
+ const viewRef = (0, import_react15.useRef)(null);
31223
+ const [layoutReady, setLayoutReady] = (0, import_react15.useState)(false);
31224
+ const [previewUri, setPreviewUri] = (0, import_react15.useState)(null);
31225
+ (0, import_react15.useEffect)(() => {
31075
31226
  if (!layoutReady || !useNativePreview || !shouldRenderPreview) return;
31076
- const viewTag = (0, import_react_native13.findNodeHandle)(viewRef.current);
31227
+ const viewTag = (0, import_react_native14.findNodeHandle)(viewRef.current);
31077
31228
  if (!viewTag) return;
31078
- const isNative = import_react_native13.Platform.OS === "android" || import_react_native13.Platform.OS === "ios";
31229
+ const isNative = import_react_native14.Platform.OS === "android" || import_react_native14.Platform.OS === "ios";
31079
31230
  const renderScale = isNative ? 2 / Math.max(zoom, 0.5) : 2;
31080
31231
  void engine.renderPage(pageIndex, viewTag, renderScale);
31081
31232
  }, [
@@ -31086,7 +31237,7 @@ var PageThumbnail = ({
31086
31237
  useNativePreview,
31087
31238
  zoom
31088
31239
  ]);
31089
- (0, import_react14.useEffect)(() => {
31240
+ (0, import_react15.useEffect)(() => {
31090
31241
  if (!useImagePreview || !shouldRenderPreview) {
31091
31242
  setPreviewUri(null);
31092
31243
  return;
@@ -31110,7 +31261,7 @@ var PageThumbnail = ({
31110
31261
  }
31111
31262
  };
31112
31263
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31113
- import_react_native13.Pressable,
31264
+ import_react_native14.Pressable,
31114
31265
  {
31115
31266
  onPress,
31116
31267
  style: [
@@ -31122,23 +31273,23 @@ var PageThumbnail = ({
31122
31273
  ],
31123
31274
  children: [
31124
31275
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31125
- import_react_native13.View,
31276
+ import_react_native14.View,
31126
31277
  {
31127
31278
  onLayout: handleLayout,
31128
31279
  style: [styles12.thumbFrame, { width: frameWidth, height: frameHeight }],
31129
31280
  children: useNativePreview && shouldRenderPreview ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_engine_native7.PapyrusPageView, { ref: viewRef, style: styles12.thumbView }) : useImagePreview && shouldRenderPreview && previewUri ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31130
- import_react_native13.Image,
31281
+ import_react_native14.Image,
31131
31282
  {
31132
31283
  source: { uri: previewUri },
31133
31284
  resizeMode: "contain",
31134
31285
  style: styles12.thumbImage
31135
31286
  }
31136
31287
  ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31137
- import_react_native13.View,
31288
+ import_react_native14.View,
31138
31289
  {
31139
31290
  style: [styles12.thumbFallback, isDark && styles12.thumbFallbackDark],
31140
31291
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31141
- import_react_native13.Text,
31292
+ import_react_native14.Text,
31142
31293
  {
31143
31294
  style: [
31144
31295
  styles12.thumbFallbackText,
@@ -31151,7 +31302,7 @@ var PageThumbnail = ({
31151
31302
  )
31152
31303
  }
31153
31304
  ),
31154
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.Text, { style: [styles12.thumbLabel, isDark && styles12.thumbLabelDark], children: pageIndex + 1 })
31305
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.thumbLabel, isDark && styles12.thumbLabelDark], children: pageIndex + 1 })
31155
31306
  ]
31156
31307
  }
31157
31308
  );
@@ -31159,16 +31310,16 @@ var PageThumbnail = ({
31159
31310
  var OutlineNode = ({ item, depth = 0, isDark, onSelect, untitledLabel }) => {
31160
31311
  const hasChildren = item.children && item.children.length > 0;
31161
31312
  const isClickable = item.pageIndex >= 0;
31162
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { children: [
31313
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { children: [
31163
31314
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31164
- import_react_native13.Pressable,
31315
+ import_react_native14.Pressable,
31165
31316
  {
31166
31317
  onPress: () => {
31167
31318
  if (isClickable) onSelect(item.pageIndex);
31168
31319
  },
31169
31320
  style: [styles12.outlineRow, { paddingLeft: 12 + depth * 12 }],
31170
31321
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31171
- import_react_native13.Text,
31322
+ import_react_native14.Text,
31172
31323
  {
31173
31324
  style: [
31174
31325
  styles12.outlineText,
@@ -31215,12 +31366,12 @@ var RightSheet = ({
31215
31366
  zoom,
31216
31367
  locale,
31217
31368
  accentColor
31218
- } = (0, import_core10.useViewerStore)();
31219
- const { height: windowHeight, width: windowWidth } = (0, import_react_native13.useWindowDimensions)();
31220
- const [pagesMode, setPagesMode] = (0, import_react14.useState)(
31369
+ } = (0, import_core11.useViewerStore)();
31370
+ const { height: windowHeight, width: windowWidth } = (0, import_react_native14.useWindowDimensions)();
31371
+ const [pagesMode, setPagesMode] = (0, import_react15.useState)(
31221
31372
  documentType === "pdf" || documentType === "comic" ? "thumbnails" : "summary"
31222
31373
  );
31223
- (0, import_react14.useEffect)(() => {
31374
+ (0, import_react15.useEffect)(() => {
31224
31375
  setPagesMode(
31225
31376
  documentType === "pdf" || documentType === "comic" ? "thumbnails" : "summary"
31226
31377
  );
@@ -31237,16 +31388,16 @@ var RightSheet = ({
31237
31388
  const { cardWidth, frameWidth } = getRightSheetThumbnailLayout(sheetWidth);
31238
31389
  const renderTarget = engine.getRenderTargetType?.();
31239
31390
  const hasNativePageView = Boolean(
31240
- import_react_native13.UIManager.getViewManagerConfig?.("PapyrusPageView")
31391
+ import_react_native14.UIManager.getViewManagerConfig?.("PapyrusPageView")
31241
31392
  );
31242
31393
  const useNativePreview = renderTarget !== "webview" && hasNativePageView;
31243
31394
  const useImagePreview = documentType === "comic" && renderTarget === "webview" && typeof engine.getPagePreview === "function";
31244
- const thumbnailDimensionsCacheRef = (0, import_react14.useRef)(/* @__PURE__ */ new Map());
31245
- const thumbnailDimensionsPendingRef = (0, import_react14.useRef)(/* @__PURE__ */ new Set());
31246
- const thumbnailRefreshTimeoutRef = (0, import_react14.useRef)(null);
31247
- const [thumbnailLayoutRevision, setThumbnailLayoutRevision] = (0, import_react14.useState)(0);
31248
- const [visibleThumbnailPages, setVisibleThumbnailPages] = (0, import_react14.useState)(() => /* @__PURE__ */ new Set());
31249
- const resolvedThumbsInitialCount = (0, import_react14.useMemo)(
31395
+ const thumbnailDimensionsCacheRef = (0, import_react15.useRef)(/* @__PURE__ */ new Map());
31396
+ const thumbnailDimensionsPendingRef = (0, import_react15.useRef)(/* @__PURE__ */ new Set());
31397
+ const thumbnailRefreshTimeoutRef = (0, import_react15.useRef)(null);
31398
+ const [thumbnailLayoutRevision, setThumbnailLayoutRevision] = (0, import_react15.useState)(0);
31399
+ const [visibleThumbnailPages, setVisibleThumbnailPages] = (0, import_react15.useState)(() => /* @__PURE__ */ new Set());
31400
+ const resolvedThumbsInitialCount = (0, import_react15.useMemo)(
31250
31401
  () => resolvePositiveInt2(
31251
31402
  thumbsInitialCount,
31252
31403
  THUMBNAILS_INITIAL_NUM_TO_RENDER,
@@ -31265,10 +31416,10 @@ var RightSheet = ({
31265
31416
  const navigationTitle = showingProgress ? t.progress : documentType === "epub" || activeMobileDestination === "contents" ? t.contents : t.pages;
31266
31417
  const summaryLabel = documentType === "epub" ? t.contents : t.summaryTab;
31267
31418
  const thumbnailLabel = documentType === "epub" ? t.pages : t.pagesTab;
31268
- const closeSheet = (0, import_react14.useCallback)(() => {
31419
+ const closeSheet = (0, import_react15.useCallback)(() => {
31269
31420
  setDocumentState({ sidebarRightOpen: false });
31270
31421
  }, [setDocumentState]);
31271
- const jumpToPage = (0, import_react14.useCallback)(
31422
+ const jumpToPage = (0, import_react15.useCallback)(
31272
31423
  (pageIndex) => {
31273
31424
  engine.goToPage(pageIndex + 1);
31274
31425
  setDocumentState({ currentPage: pageIndex + 1 });
@@ -31277,14 +31428,14 @@ var RightSheet = ({
31277
31428
  },
31278
31429
  [closeSheet, engine, setDocumentState, triggerScrollToPage]
31279
31430
  );
31280
- const scheduleThumbnailLayoutRefresh = (0, import_react14.useCallback)(() => {
31431
+ const scheduleThumbnailLayoutRefresh = (0, import_react15.useCallback)(() => {
31281
31432
  if (thumbnailRefreshTimeoutRef.current) return;
31282
31433
  thumbnailRefreshTimeoutRef.current = setTimeout(() => {
31283
31434
  thumbnailRefreshTimeoutRef.current = null;
31284
31435
  setThumbnailLayoutRevision((value) => value + 1);
31285
31436
  }, 80);
31286
31437
  }, []);
31287
- const ensureThumbnailDimensions = (0, import_react14.useCallback)(
31438
+ const ensureThumbnailDimensions = (0, import_react15.useCallback)(
31288
31439
  (pageIndex) => {
31289
31440
  if (pageIndex < 0 || pageIndex >= pageCount) return;
31290
31441
  if (thumbnailDimensionsCacheRef.current.has(pageIndex)) return;
@@ -31303,7 +31454,7 @@ var RightSheet = ({
31303
31454
  },
31304
31455
  [engine, pageCount, scheduleThumbnailLayoutRefresh]
31305
31456
  );
31306
- const getThumbnailFrameHeight = (0, import_react14.useCallback)(
31457
+ const getThumbnailFrameHeight = (0, import_react15.useCallback)(
31307
31458
  (pageIndex) => {
31308
31459
  const dims = thumbnailDimensionsCacheRef.current.get(pageIndex);
31309
31460
  const ratio = !dims || dims.width <= 0 || dims.height <= 0 ? THUMBNAILS_DEFAULT_ASPECT_RATIO : dims.height / dims.width;
@@ -31315,7 +31466,7 @@ var RightSheet = ({
31315
31466
  },
31316
31467
  [frameWidth, thumbnailLayoutRevision]
31317
31468
  );
31318
- (0, import_react14.useEffect)(
31469
+ (0, import_react15.useEffect)(
31319
31470
  () => () => {
31320
31471
  if (thumbnailRefreshTimeoutRef.current) {
31321
31472
  clearTimeout(thumbnailRefreshTimeoutRef.current);
@@ -31323,11 +31474,11 @@ var RightSheet = ({
31323
31474
  },
31324
31475
  []
31325
31476
  );
31326
- (0, import_react14.useEffect)(() => {
31477
+ (0, import_react15.useEffect)(() => {
31327
31478
  if (sidebarRightOpen) return;
31328
31479
  setVisibleThumbnailPages(/* @__PURE__ */ new Set());
31329
31480
  }, [sidebarRightOpen]);
31330
- (0, import_react14.useEffect)(() => {
31481
+ (0, import_react15.useEffect)(() => {
31331
31482
  if (!sidebarRightOpen || sidebarRightTab !== "pages") return;
31332
31483
  if (activeMobileDestination === "pages") {
31333
31484
  setPagesMode("thumbnails");
@@ -31335,7 +31486,7 @@ var RightSheet = ({
31335
31486
  }
31336
31487
  setPagesMode("summary");
31337
31488
  }, [activeMobileDestination, sidebarRightOpen, sidebarRightTab]);
31338
- (0, import_react14.useEffect)(() => {
31489
+ (0, import_react15.useEffect)(() => {
31339
31490
  if (!sidebarRightOpen || sidebarRightTab !== "pages") return;
31340
31491
  if (pagesMode !== "thumbnails" || !supportsThumbnails) return;
31341
31492
  if (pageCount <= 0) return;
@@ -31365,18 +31516,18 @@ var RightSheet = ({
31365
31516
  sidebarRightTab,
31366
31517
  supportsThumbnails
31367
31518
  ]);
31368
- const pages = (0, import_react14.useMemo)(
31519
+ const pages = (0, import_react15.useMemo)(
31369
31520
  () => Array.from({ length: pageCount }, (_, i) => i),
31370
31521
  [pageCount]
31371
31522
  );
31372
- const progressEntries = (0, import_react14.useMemo)(
31523
+ const progressEntries = (0, import_react15.useMemo)(
31373
31524
  () => pages.map((pageIndex) => ({
31374
31525
  pageIndex,
31375
31526
  percent: pageCount <= 1 ? 100 : Math.round((pageIndex + 1) / pageCount * 100)
31376
31527
  })),
31377
31528
  [pageCount, pages]
31378
31529
  );
31379
- const onThumbnailsViewableItemsChanged = (0, import_react14.useCallback)(
31530
+ const onThumbnailsViewableItemsChanged = (0, import_react15.useCallback)(
31380
31531
  ({ viewableItems }) => {
31381
31532
  const nextVisible = /* @__PURE__ */ new Set();
31382
31533
  viewableItems.forEach((token) => {
@@ -31393,7 +31544,7 @@ var RightSheet = ({
31393
31544
  },
31394
31545
  [ensureThumbnailDimensions]
31395
31546
  );
31396
- const renderThumbnailItem = (0, import_react14.useCallback)(
31547
+ const renderThumbnailItem = (0, import_react15.useCallback)(
31397
31548
  ({ item }) => {
31398
31549
  const shouldRenderPreview = (useNativePreview || useImagePreview) && (visibleThumbnailPages.has(item) || item < resolvedThumbsPrewarmCount || Math.abs(item + 1 - currentPage) <= 1);
31399
31550
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -31444,18 +31595,18 @@ var RightSheet = ({
31444
31595
  backgroundColor: palette.surface,
31445
31596
  borderTopColor: palette.divider
31446
31597
  },
31447
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.sheet, children: [
31448
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.header, children: [
31449
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.Text, { style: [styles12.sheetTitle, isDark && styles12.sheetTitleDark], children: showingNotes ? t.notes : navigationTitle }),
31598
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.sheet, children: [
31599
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.header, children: [
31600
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.sheetTitle, isDark && styles12.sheetTitleDark], children: showingNotes ? t.notes : navigationTitle }),
31450
31601
  !showingNotes ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31451
- import_react_native13.Pressable,
31602
+ import_react_native14.Pressable,
31452
31603
  {
31453
31604
  onPress: showingProgress ? void 0 : onOpenPageJump,
31454
31605
  disabled: showingProgress || pageCount <= 0,
31455
31606
  style: styles12.pageStatusHit,
31456
31607
  accessibilityLabel: "Open page jump",
31457
31608
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31458
- import_react_native13.Text,
31609
+ import_react_native14.Text,
31459
31610
  {
31460
31611
  style: [styles12.pageStatus, isDark && styles12.pageStatusDark],
31461
31612
  children: showingProgress ? `${Math.round(
@@ -31466,7 +31617,7 @@ var RightSheet = ({
31466
31617
  }
31467
31618
  ) : null,
31468
31619
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31469
- import_react_native13.Pressable,
31620
+ import_react_native14.Pressable,
31470
31621
  {
31471
31622
  accessibilityRole: "button",
31472
31623
  accessibilityLabel: `${t.close} ${showingNotes ? t.notes.toLowerCase() : t.contents.toLowerCase()}`,
@@ -31476,14 +31627,14 @@ var RightSheet = ({
31476
31627
  }
31477
31628
  )
31478
31629
  ] }),
31479
- !showingNotes ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.pagesContent, children: [
31480
- !showingProgress ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.View, { style: styles12.pageHeader, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31481
- import_react_native13.View,
31630
+ !showingNotes ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.pagesContent, children: [
31631
+ !showingProgress ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.View, { style: styles12.pageHeader, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31632
+ import_react_native14.View,
31482
31633
  {
31483
31634
  style: [styles12.segmented, isDark && styles12.segmentedDark],
31484
31635
  children: [
31485
31636
  supportsThumbnails ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31486
- import_react_native13.Pressable,
31637
+ import_react_native14.Pressable,
31487
31638
  {
31488
31639
  onPress: () => setPagesMode("thumbnails"),
31489
31640
  style: [
@@ -31494,7 +31645,7 @@ var RightSheet = ({
31494
31645
  }
31495
31646
  ],
31496
31647
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31497
- import_react_native13.Text,
31648
+ import_react_native14.Text,
31498
31649
  {
31499
31650
  style: [
31500
31651
  styles12.segmentText,
@@ -31507,7 +31658,7 @@ var RightSheet = ({
31507
31658
  }
31508
31659
  ) : null,
31509
31660
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31510
- import_react_native13.Pressable,
31661
+ import_react_native14.Pressable,
31511
31662
  {
31512
31663
  onPress: () => setPagesMode("summary"),
31513
31664
  style: [
@@ -31518,7 +31669,7 @@ var RightSheet = ({
31518
31669
  }
31519
31670
  ],
31520
31671
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31521
- import_react_native13.Text,
31672
+ import_react_native14.Text,
31522
31673
  {
31523
31674
  style: [
31524
31675
  styles12.segmentText,
@@ -31561,7 +31712,7 @@ var RightSheet = ({
31561
31712
  children: progressEntries.map((entry) => {
31562
31713
  const isActive = entry.pageIndex + 1 === currentPage;
31563
31714
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31564
- import_react_native13.Pressable,
31715
+ import_react_native14.Pressable,
31565
31716
  {
31566
31717
  onPress: () => jumpToPage(entry.pageIndex),
31567
31718
  style: [
@@ -31571,7 +31722,7 @@ var RightSheet = ({
31571
31722
  ],
31572
31723
  children: [
31573
31724
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31574
- import_react_native13.Text,
31725
+ import_react_native14.Text,
31575
31726
  {
31576
31727
  style: [
31577
31728
  styles12.progressLabel,
@@ -31584,7 +31735,7 @@ var RightSheet = ({
31584
31735
  }
31585
31736
  ),
31586
31737
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31587
- import_react_native13.Text,
31738
+ import_react_native14.Text,
31588
31739
  {
31589
31740
  style: [
31590
31741
  styles12.progressMeta,
@@ -31609,7 +31760,7 @@ var RightSheet = ({
31609
31760
  contentContainerStyle: styles12.summaryContent,
31610
31761
  showsVerticalScrollIndicator: false,
31611
31762
  children: outline.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31612
- import_react_native13.Text,
31763
+ import_react_native14.Text,
31613
31764
  {
31614
31765
  style: [styles12.emptyText, isDark && styles12.emptyTextDark],
31615
31766
  children: t.noSummary
@@ -31631,8 +31782,8 @@ var RightSheet = ({
31631
31782
  {
31632
31783
  contentContainerStyle: styles12.notesContent,
31633
31784
  showsVerticalScrollIndicator: false,
31634
- children: annotations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.Text, { style: [styles12.emptyText, isDark && styles12.emptyTextDark], children: t.noAnnotations }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.View, { children: annotations.map((ann) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31635
- import_react_native13.Pressable,
31785
+ children: annotations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.emptyText, isDark && styles12.emptyTextDark], children: t.noAnnotations }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.View, { children: annotations.map((ann) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31786
+ import_react_native14.Pressable,
31636
31787
  {
31637
31788
  onPress: () => {
31638
31789
  setSelectedAnnotation(ann.id);
@@ -31647,27 +31798,27 @@ var RightSheet = ({
31647
31798
  }
31648
31799
  ],
31649
31800
  children: [
31650
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.noteHeader, children: [
31801
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.noteHeader, children: [
31651
31802
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31652
- import_react_native13.View,
31803
+ import_react_native14.View,
31653
31804
  {
31654
31805
  style: [styles12.noteDot, { backgroundColor: ann.color }]
31655
31806
  }
31656
31807
  ),
31657
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.Text, { style: [styles12.noteTitle, { color: palette.text }], children: [
31808
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.Text, { style: [styles12.noteTitle, { color: palette.text }], children: [
31658
31809
  t.page,
31659
31810
  " ",
31660
31811
  ann.pageIndex + 1
31661
31812
  ] })
31662
31813
  ] }),
31663
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.Text, { style: [styles12.noteType, { color: accentColor }], children: getAnnotationKindLabel(ann.type, locale) }),
31814
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.noteType, { color: accentColor }], children: getAnnotationKindLabel(ann.type, locale) }),
31664
31815
  ann.content ? (() => {
31665
31816
  const parts = resolveNoteQuoteParts(
31666
31817
  ann.content ?? ""
31667
31818
  );
31668
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.noteQuoteRow, children: [
31819
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.noteQuoteRow, children: [
31669
31820
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31670
- import_react_native13.View,
31821
+ import_react_native14.View,
31671
31822
  {
31672
31823
  accessible: false,
31673
31824
  importantForAccessibility: "no",
@@ -31676,7 +31827,7 @@ var RightSheet = ({
31676
31827
  }
31677
31828
  ),
31678
31829
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31679
- import_react_native13.Text,
31830
+ import_react_native14.Text,
31680
31831
  {
31681
31832
  style: [
31682
31833
  styles12.noteContent,
@@ -31693,7 +31844,7 @@ var RightSheet = ({
31693
31844
  }
31694
31845
  ),
31695
31846
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31696
- import_react_native13.View,
31847
+ import_react_native14.View,
31697
31848
  {
31698
31849
  accessible: false,
31699
31850
  importantForAccessibility: "no",
@@ -31713,7 +31864,7 @@ var RightSheet = ({
31713
31864
  }
31714
31865
  );
31715
31866
  };
31716
- var styles12 = import_react_native13.StyleSheet.create({
31867
+ var styles12 = import_react_native14.StyleSheet.create({
31717
31868
  sheet: {
31718
31869
  flex: 1,
31719
31870
  maxHeight: "100%",
@@ -31999,9 +32150,9 @@ var styles12 = import_react_native13.StyleSheet.create({
31999
32150
  var RightSheet_default = RightSheet;
32000
32151
 
32001
32152
  // components/AnnotationEditor.tsx
32002
- var import_react15 = require("react");
32003
- var import_react_native14 = require("react-native");
32004
- var import_core11 = require("@papyrus-sdk/core");
32153
+ var import_react16 = require("react");
32154
+ var import_react_native15 = require("react-native");
32155
+ var import_core12 = require("@papyrus-sdk/core");
32005
32156
  var import_jsx_runtime17 = require("react/jsx-runtime");
32006
32157
  var AnnotationEditor = () => {
32007
32158
  const {
@@ -32013,13 +32164,13 @@ var AnnotationEditor = () => {
32013
32164
  uiTheme,
32014
32165
  locale,
32015
32166
  accentColor
32016
- } = (0, import_core11.useViewerStore)();
32167
+ } = (0, import_core12.useViewerStore)();
32017
32168
  const annotation = annotations.find((ann) => ann.id === selectedAnnotationId);
32018
32169
  const isEditable = annotation && (annotation.type === "text" || annotation.type === "comment");
32019
- const [draft, setDraft] = (0, import_react15.useState)("");
32170
+ const [draft, setDraft] = (0, import_react16.useState)("");
32020
32171
  const isDark = uiTheme === "dark";
32021
32172
  const t = getStrings(locale);
32022
- (0, import_react15.useEffect)(() => {
32173
+ (0, import_react16.useEffect)(() => {
32023
32174
  if (isEditable) {
32024
32175
  setDraft(annotation?.content ?? "");
32025
32176
  }
@@ -32038,16 +32189,16 @@ var AnnotationEditor = () => {
32038
32189
  );
32039
32190
  };
32040
32191
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32041
- import_react_native14.Modal,
32192
+ import_react_native15.Modal,
32042
32193
  {
32043
32194
  visible: true,
32044
32195
  transparent: true,
32045
32196
  animationType: "fade",
32046
32197
  onRequestClose: handleClose,
32047
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.View, { style: styles13.overlay, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native14.View, { style: [styles13.card, isDark && styles13.cardDark], children: [
32048
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: [styles13.title, isDark && styles13.titleDark], children: t.editNote }),
32198
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.View, { style: styles13.overlay, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native15.View, { style: [styles13.card, isDark && styles13.cardDark], children: [
32199
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: [styles13.title, isDark && styles13.titleDark], children: t.editNote }),
32049
32200
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32050
- import_react_native14.TextInput,
32201
+ import_react_native15.TextInput,
32051
32202
  {
32052
32203
  style: [styles13.input, isDark && styles13.inputDark],
32053
32204
  value: draft,
@@ -32057,9 +32208,9 @@ var AnnotationEditor = () => {
32057
32208
  multiline: true
32058
32209
  }
32059
32210
  ),
32060
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native14.View, { style: styles13.actions, children: [
32211
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native15.View, { style: styles13.actions, children: [
32061
32212
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32062
- import_react_native14.Pressable,
32213
+ import_react_native15.Pressable,
32063
32214
  {
32064
32215
  onPress: handleDelete,
32065
32216
  style: [
@@ -32070,20 +32221,20 @@ var AnnotationEditor = () => {
32070
32221
  accessibilityRole: "button",
32071
32222
  accessibilityLabel: t.deleteAnnotation,
32072
32223
  testID: "annotation-delete-button",
32073
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.deleteAnnotation })
32224
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.deleteAnnotation })
32074
32225
  }
32075
32226
  ),
32076
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.View, { style: styles13.actionSpacer }),
32227
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.View, { style: styles13.actionSpacer }),
32077
32228
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32078
- import_react_native14.Pressable,
32229
+ import_react_native15.Pressable,
32079
32230
  {
32080
32231
  onPress: handleClose,
32081
32232
  style: [styles13.actionButton, styles13.actionCancel],
32082
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: styles13.actionText, children: t.cancel })
32233
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: styles13.actionText, children: t.cancel })
32083
32234
  }
32084
32235
  ),
32085
32236
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32086
- import_react_native14.Pressable,
32237
+ import_react_native15.Pressable,
32087
32238
  {
32088
32239
  onPress: handleSave,
32089
32240
  style: [
@@ -32091,7 +32242,7 @@ var AnnotationEditor = () => {
32091
32242
  styles13.actionSave,
32092
32243
  { backgroundColor: accentColor }
32093
32244
  ],
32094
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.save })
32245
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.save })
32095
32246
  }
32096
32247
  )
32097
32248
  ] })
@@ -32099,7 +32250,7 @@ var AnnotationEditor = () => {
32099
32250
  }
32100
32251
  );
32101
32252
  };
32102
- var styles13 = import_react_native14.StyleSheet.create({
32253
+ var styles13 = import_react_native15.StyleSheet.create({
32103
32254
  overlay: {
32104
32255
  flex: 1,
32105
32256
  alignItems: "center",
@@ -32176,8 +32327,9 @@ var styles13 = import_react_native14.StyleSheet.create({
32176
32327
  var AnnotationEditor_default = AnnotationEditor;
32177
32328
 
32178
32329
  // components/BottomBar.tsx
32179
- var import_react_native15 = require("react-native");
32180
- var import_core12 = require("@papyrus-sdk/core");
32330
+ var import_react_native16 = require("react-native");
32331
+ var import_core13 = require("@papyrus-sdk/core");
32332
+ var import_react_native_reanimated3 = __toESM(require("react-native-reanimated"));
32181
32333
 
32182
32334
  // components/bottomBarModel.ts
32183
32335
  function buildBottomBarLayout({
@@ -32246,12 +32398,20 @@ var BottomBar = ({
32246
32398
  mobileChromeVisible,
32247
32399
  toolDockOpen,
32248
32400
  activeTool,
32249
- interactionMode,
32250
- nativePdfViewerActive
32251
- } = (0, import_core12.useViewerStore)();
32401
+ interactionMode
32402
+ } = (0, import_core13.useViewerStore)();
32403
+ const inkSession = useNativeInkSession();
32404
+ const supportsInkChrome = documentType === "pdf" && inkSession.supported;
32405
+ const drawing = supportsInkChrome && inkSession.active;
32406
+ const dockVisible = mobileChromeVisible && mobileDockVisible && !drawing;
32407
+ const dockProgress = useNativeInkMotion(dockVisible, supportsInkChrome);
32408
+ const dockMotion = (0, import_react_native_reanimated3.useAnimatedStyle)(() => ({
32409
+ opacity: dockProgress.value,
32410
+ transform: [{ translateY: (1 - dockProgress.value) * 8 }]
32411
+ }));
32252
32412
  const isDark = uiTheme === "dark";
32253
32413
  const t = getStrings(locale);
32254
- const { width, height } = (0, import_react_native15.useWindowDimensions)();
32414
+ const { width, height } = (0, import_react_native16.useWindowDimensions)();
32255
32415
  const isLandscape = width > height;
32256
32416
  const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
32257
32417
  const iconColor = (active) => {
@@ -32268,7 +32428,7 @@ var BottomBar = ({
32268
32428
  label: t.tools,
32269
32429
  icon: IconToolDockTrigger,
32270
32430
  onPress: () => {
32271
- const isNativeIosInkViewer = import_react_native15.Platform.OS === "ios" && Number.parseInt(String(import_react_native15.Platform.Version), 10) >= 16 && nativePdfViewerActive;
32431
+ const isNativeIosInkViewer = supportsInkChrome;
32272
32432
  const action = resolveAnnotateButtonAction({
32273
32433
  isNativeIosInkViewer,
32274
32434
  activeTool,
@@ -32285,13 +32445,7 @@ var BottomBar = ({
32285
32445
  return;
32286
32446
  }
32287
32447
  if (action === "deactivate-native-ink") {
32288
- setDocumentState({
32289
- activeTool: "select",
32290
- interactionMode: "pan",
32291
- nativeInkToolPickerActive: false,
32292
- toolDockOpen: false,
32293
- activeMobileDestination: "none"
32294
- });
32448
+ inkSession.finish();
32295
32449
  return;
32296
32450
  }
32297
32451
  if (action === "dismiss-tool-dock") {
@@ -32329,98 +32483,110 @@ var BottomBar = ({
32329
32483
  onPress: onOpenSettings
32330
32484
  }
32331
32485
  };
32332
- if (!mobileChromeVisible || !mobileDockVisible) return null;
32333
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native15.View, { pointerEvents: "box-none", style: [styles14.frame, { paddingBottom: offsets.bottom, paddingLeft: offsets.left, paddingRight: offsets.right }], children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native15.View, { style: [styles14.row, isLandscape && styles14.rowLandscape], children: [
32334
- layout.leftSlots.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32335
- import_react_native15.View,
32336
- {
32337
- style: [
32338
- styles14.island,
32339
- styles14.editIsland,
32340
- isDark && styles14.islandDark
32341
- ],
32342
- testID: "papyrus-floating-bottom-dock-edit",
32343
- children: layout.leftSlots.map((slot) => {
32344
- const meta = slotMeta[slot.key];
32345
- const Icon = meta.icon;
32346
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32347
- import_react_native15.Pressable,
32348
- {
32349
- onPress: meta.onPress,
32350
- style: [
32351
- styles14.iconOnlyItem,
32352
- slot.active && styles14.itemActive
32353
- ],
32354
- accessibilityLabel: meta.label,
32355
- testID: `papyrus-mobile-destination-${slot.key}`,
32356
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32357
- import_react_native15.View,
32486
+ if (!dockVisible && !supportsInkChrome) return null;
32487
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32488
+ import_react_native_reanimated3.default.View,
32489
+ {
32490
+ pointerEvents: dockVisible ? "box-none" : "none",
32491
+ accessibilityElementsHidden: !dockVisible,
32492
+ importantForAccessibility: dockVisible ? "auto" : "no-hide-descendants",
32493
+ testID: "papyrus-bottom-bar-frame",
32494
+ style: [styles14.frame, { paddingBottom: offsets.bottom, paddingLeft: offsets.left, paddingRight: offsets.right }, dockMotion],
32495
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native16.View, { style: [styles14.row, isLandscape && styles14.rowLandscape], children: [
32496
+ layout.leftSlots.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32497
+ import_react_native16.View,
32498
+ {
32499
+ style: [
32500
+ styles14.island,
32501
+ styles14.editIsland,
32502
+ isDark && styles14.islandDark
32503
+ ],
32504
+ testID: "papyrus-floating-bottom-dock-edit",
32505
+ children: layout.leftSlots.map((slot) => {
32506
+ const meta = slotMeta[slot.key];
32507
+ const Icon = meta.icon;
32508
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32509
+ import_react_native16.Pressable,
32358
32510
  {
32511
+ disabled: !dockVisible,
32512
+ onPress: meta.onPress,
32359
32513
  style: [
32360
- styles14.itemIcon,
32361
- isDark && styles14.itemIconDark,
32362
- slot.active && styles14.itemIconActive
32514
+ styles14.iconOnlyItem,
32515
+ slot.active && styles14.itemActive
32363
32516
  ],
32517
+ accessibilityLabel: meta.label,
32518
+ testID: `papyrus-mobile-destination-${slot.key}`,
32364
32519
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32365
- Icon,
32520
+ import_react_native16.View,
32366
32521
  {
32367
- size: MOBILE_CHROME_METRICS.iconSize,
32368
- color: iconColor(slot.active)
32522
+ style: [
32523
+ styles14.itemIcon,
32524
+ isDark && styles14.itemIconDark,
32525
+ slot.active && styles14.itemIconActive
32526
+ ],
32527
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32528
+ Icon,
32529
+ {
32530
+ size: MOBILE_CHROME_METRICS.iconSize,
32531
+ color: iconColor(slot.active)
32532
+ }
32533
+ )
32369
32534
  }
32370
32535
  )
32371
- }
32372
- )
32373
- },
32374
- slot.key
32375
- );
32376
- })
32377
- }
32378
- ) : null,
32379
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32380
- import_react_native15.View,
32381
- {
32382
- style: [
32383
- styles14.island,
32384
- styles14.utilityIsland,
32385
- isDark && styles14.islandDark
32386
- ],
32387
- testID: "papyrus-floating-bottom-dock",
32388
- children: layout.rightSlots.map((slot) => {
32389
- const meta = slotMeta[slot.key];
32390
- const Icon = meta.icon;
32391
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32392
- import_react_native15.Pressable,
32393
- {
32394
- onPress: meta.onPress,
32395
- style: [styles14.iconOnlyItem, slot.active && styles14.itemActive],
32396
- accessibilityLabel: meta.label,
32397
- testID: `papyrus-mobile-destination-${slot.key}`,
32398
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32399
- import_react_native15.View,
32536
+ },
32537
+ slot.key
32538
+ );
32539
+ })
32540
+ }
32541
+ ) : null,
32542
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32543
+ import_react_native16.View,
32544
+ {
32545
+ style: [
32546
+ styles14.island,
32547
+ styles14.utilityIsland,
32548
+ isDark && styles14.islandDark
32549
+ ],
32550
+ testID: "papyrus-floating-bottom-dock",
32551
+ children: layout.rightSlots.map((slot) => {
32552
+ const meta = slotMeta[slot.key];
32553
+ const Icon = meta.icon;
32554
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32555
+ import_react_native16.Pressable,
32400
32556
  {
32401
- style: [
32402
- styles14.itemIcon,
32403
- isDark && styles14.itemIconDark,
32404
- slot.active && styles14.itemIconActive
32405
- ],
32557
+ disabled: !dockVisible,
32558
+ onPress: meta.onPress,
32559
+ style: [styles14.iconOnlyItem, slot.active && styles14.itemActive],
32560
+ accessibilityLabel: meta.label,
32561
+ testID: `papyrus-mobile-destination-${slot.key}`,
32406
32562
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32407
- Icon,
32563
+ import_react_native16.View,
32408
32564
  {
32409
- size: MOBILE_CHROME_METRICS.iconSize,
32410
- color: iconColor(slot.active)
32565
+ style: [
32566
+ styles14.itemIcon,
32567
+ isDark && styles14.itemIconDark,
32568
+ slot.active && styles14.itemIconActive
32569
+ ],
32570
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32571
+ Icon,
32572
+ {
32573
+ size: MOBILE_CHROME_METRICS.iconSize,
32574
+ color: iconColor(slot.active)
32575
+ }
32576
+ )
32411
32577
  }
32412
32578
  )
32413
- }
32414
- )
32415
- },
32416
- slot.key
32417
- );
32418
- })
32419
- }
32420
- )
32421
- ] }) });
32579
+ },
32580
+ slot.key
32581
+ );
32582
+ })
32583
+ }
32584
+ )
32585
+ ] })
32586
+ }
32587
+ );
32422
32588
  };
32423
- var styles14 = import_react_native15.StyleSheet.create({
32589
+ var styles14 = import_react_native16.StyleSheet.create({
32424
32590
  frame: {
32425
32591
  position: "absolute",
32426
32592
  left: 0,
@@ -32500,8 +32666,8 @@ var styles14 = import_react_native15.StyleSheet.create({
32500
32666
  var BottomBar_default = BottomBar;
32501
32667
 
32502
32668
  // components/SettingsSheet.tsx
32503
- var import_react_native16 = require("react-native");
32504
- var import_core13 = require("@papyrus-sdk/core");
32669
+ var import_react_native17 = require("react-native");
32670
+ var import_core14 = require("@papyrus-sdk/core");
32505
32671
 
32506
32672
  // components/rotationReset.ts
32507
32673
  var resetEngineRotation = (engine, onRotationChange) => {
@@ -32527,13 +32693,13 @@ var PAGE_THEME_OPTIONS = [
32527
32693
  ];
32528
32694
  var ThemeSwatch = ({ value }) => {
32529
32695
  if (value === "high-contrast") {
32530
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: [styles15.themeSwatch, styles15.themeSwatchContrast], children: [
32531
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.themeSwatchContrastHalfDark }),
32532
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.themeSwatchContrastHalfLight })
32696
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: [styles15.themeSwatch, styles15.themeSwatchContrast], children: [
32697
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.themeSwatchContrastHalfDark }),
32698
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.themeSwatchContrastHalfLight })
32533
32699
  ] });
32534
32700
  }
32535
32701
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32536
- import_react_native16.View,
32702
+ import_react_native17.View,
32537
32703
  {
32538
32704
  style: [
32539
32705
  styles15.themeSwatch,
@@ -32561,12 +32727,12 @@ var SettingsSheet = ({
32561
32727
  comicLayoutMode,
32562
32728
  comicFitMode,
32563
32729
  comicReadingDirection
32564
- } = (0, import_core13.useViewerStore)();
32730
+ } = (0, import_core14.useViewerStore)();
32565
32731
  const isDark = uiTheme === "dark";
32566
32732
  const isPaged = viewMode === "single";
32567
32733
  const isDouble = viewMode === "double";
32568
32734
  const t = getStrings(locale);
32569
- const { height: windowHeight } = (0, import_react_native16.useWindowDimensions)();
32735
+ const { height: windowHeight } = (0, import_react_native17.useWindowDimensions)();
32570
32736
  const sheetMaxHeight = getSettingsSheetMaxHeight(windowHeight);
32571
32737
  const handleTransition = (mode) => {
32572
32738
  if (mode === "paged") {
@@ -32613,58 +32779,58 @@ var SettingsSheet = ({
32613
32779
  contentContainerStyle: styles15.sheetContent,
32614
32780
  showsVerticalScrollIndicator: false,
32615
32781
  children: [
32616
- documentType === "comic" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32617
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicMode }),
32618
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.optionRow, children: ["single", "continuous"].map((mode) => {
32782
+ documentType === "comic" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32783
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicMode }),
32784
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.optionRow, children: ["single", "continuous"].map((mode) => {
32619
32785
  const active = comicLayoutMode === mode;
32620
32786
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32621
- import_react_native16.Pressable,
32787
+ import_react_native17.Pressable,
32622
32788
  {
32623
32789
  onPress: () => setDocumentState({ comicLayoutMode: mode }),
32624
32790
  style: [styles15.optionButton, isDark && styles15.optionButtonDark, active && styles15.optionButtonActive, active && { backgroundColor: accentColor }],
32625
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.Text, { style: [styles15.optionText, isDark && styles15.optionTextDark, active && styles15.optionTextActive], children: mode === "single" ? t.comicSingle : t.comicContinuous })
32791
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.optionText, isDark && styles15.optionTextDark, active && styles15.optionTextActive], children: mode === "single" ? t.comicSingle : t.comicContinuous })
32626
32792
  },
32627
32793
  mode
32628
32794
  );
32629
32795
  }) }),
32630
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicFit }),
32631
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.optionRow, children: ["width", "page"].map((mode) => {
32796
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicFit }),
32797
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.optionRow, children: ["width", "page"].map((mode) => {
32632
32798
  const active = comicFitMode === mode;
32633
32799
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32634
- import_react_native16.Pressable,
32800
+ import_react_native17.Pressable,
32635
32801
  {
32636
32802
  onPress: () => setDocumentState({ comicFitMode: mode }),
32637
32803
  style: [styles15.optionButton, isDark && styles15.optionButtonDark, active && styles15.optionButtonActive, active && { backgroundColor: accentColor }],
32638
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.Text, { style: [styles15.optionText, isDark && styles15.optionTextDark, active && styles15.optionTextActive], children: mode === "width" ? t.comicFitWidth : t.comicFitPage })
32804
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.optionText, isDark && styles15.optionTextDark, active && styles15.optionTextActive], children: mode === "width" ? t.comicFitWidth : t.comicFitPage })
32639
32805
  },
32640
32806
  mode
32641
32807
  );
32642
32808
  }) }),
32643
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicDirection }),
32644
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.optionRow, children: ["ltr", "rtl"].map((direction) => {
32809
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicDirection }),
32810
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.optionRow, children: ["ltr", "rtl"].map((direction) => {
32645
32811
  const active = comicReadingDirection === direction;
32646
32812
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32647
- import_react_native16.Pressable,
32813
+ import_react_native17.Pressable,
32648
32814
  {
32649
32815
  onPress: () => setDocumentState({ comicReadingDirection: direction }),
32650
32816
  style: [styles15.optionButton, isDark && styles15.optionButtonDark, active && styles15.optionButtonActive, active && { backgroundColor: accentColor }],
32651
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.Text, { style: [styles15.optionText, isDark && styles15.optionTextDark, active && styles15.optionTextActive], children: direction === "ltr" ? t.comicLtr : t.comicRtl })
32817
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.optionText, isDark && styles15.optionTextDark, active && styles15.optionTextActive], children: direction === "ltr" ? t.comicLtr : t.comicRtl })
32652
32818
  },
32653
32819
  direction
32654
32820
  );
32655
32821
  }) })
32656
32822
  ] }),
32657
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32823
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32658
32824
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32659
- import_react_native16.Text,
32825
+ import_react_native17.Text,
32660
32826
  {
32661
32827
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32662
32828
  children: t.appearance
32663
32829
  }
32664
32830
  ),
32665
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
32831
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32666
32832
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32667
- import_react_native16.Pressable,
32833
+ import_react_native17.Pressable,
32668
32834
  {
32669
32835
  onPress: () => setDocumentState({ uiTheme: "light" }),
32670
32836
  style: [
@@ -32674,7 +32840,7 @@ var SettingsSheet = ({
32674
32840
  uiTheme === "light" && { backgroundColor: accentColor }
32675
32841
  ],
32676
32842
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32677
- import_react_native16.Text,
32843
+ import_react_native17.Text,
32678
32844
  {
32679
32845
  style: [
32680
32846
  styles15.optionText,
@@ -32687,7 +32853,7 @@ var SettingsSheet = ({
32687
32853
  }
32688
32854
  ),
32689
32855
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32690
- import_react_native16.Pressable,
32856
+ import_react_native17.Pressable,
32691
32857
  {
32692
32858
  onPress: () => setDocumentState({ uiTheme: "dark" }),
32693
32859
  style: [
@@ -32697,7 +32863,7 @@ var SettingsSheet = ({
32697
32863
  uiTheme === "dark" && { backgroundColor: accentColor }
32698
32864
  ],
32699
32865
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32700
- import_react_native16.Text,
32866
+ import_react_native17.Text,
32701
32867
  {
32702
32868
  style: [
32703
32869
  styles15.optionText,
@@ -32711,18 +32877,18 @@ var SettingsSheet = ({
32711
32877
  )
32712
32878
  ] })
32713
32879
  ] }),
32714
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32880
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32715
32881
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32716
- import_react_native16.Text,
32882
+ import_react_native17.Text,
32717
32883
  {
32718
32884
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32719
32885
  children: t.pageTheme
32720
32886
  }
32721
32887
  ),
32722
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.themeOptionRow, children: PAGE_THEME_OPTIONS.map((option) => {
32888
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.themeOptionRow, children: PAGE_THEME_OPTIONS.map((option) => {
32723
32889
  const active = pageTheme === option.value;
32724
32890
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
32725
- import_react_native16.Pressable,
32891
+ import_react_native17.Pressable,
32726
32892
  {
32727
32893
  onPress: () => setDocumentState({ pageTheme: option.value }),
32728
32894
  style: [
@@ -32734,7 +32900,7 @@ var SettingsSheet = ({
32734
32900
  children: [
32735
32901
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ThemeSwatch, { value: option.value }),
32736
32902
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32737
- import_react_native16.Text,
32903
+ import_react_native17.Text,
32738
32904
  {
32739
32905
  style: [
32740
32906
  styles15.themeOptionLabel,
@@ -32750,17 +32916,17 @@ var SettingsSheet = ({
32750
32916
  );
32751
32917
  }) })
32752
32918
  ] }),
32753
- documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32919
+ documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32754
32920
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32755
- import_react_native16.Text,
32921
+ import_react_native17.Text,
32756
32922
  {
32757
32923
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32758
32924
  children: t.pageTransition
32759
32925
  }
32760
32926
  ),
32761
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
32927
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32762
32928
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32763
- import_react_native16.Pressable,
32929
+ import_react_native17.Pressable,
32764
32930
  {
32765
32931
  onPress: () => handleTransition("continuous"),
32766
32932
  style: [
@@ -32770,7 +32936,7 @@ var SettingsSheet = ({
32770
32936
  (!isPaged || isDouble) && { backgroundColor: accentColor }
32771
32937
  ],
32772
32938
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32773
- import_react_native16.Text,
32939
+ import_react_native17.Text,
32774
32940
  {
32775
32941
  style: [
32776
32942
  styles15.optionText,
@@ -32783,7 +32949,7 @@ var SettingsSheet = ({
32783
32949
  }
32784
32950
  ),
32785
32951
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32786
- import_react_native16.Pressable,
32952
+ import_react_native17.Pressable,
32787
32953
  {
32788
32954
  onPress: () => handleTransition("paged"),
32789
32955
  style: [
@@ -32793,7 +32959,7 @@ var SettingsSheet = ({
32793
32959
  isPaged && { backgroundColor: accentColor }
32794
32960
  ],
32795
32961
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32796
- import_react_native16.Text,
32962
+ import_react_native17.Text,
32797
32963
  {
32798
32964
  style: [
32799
32965
  styles15.optionText,
@@ -32807,17 +32973,17 @@ var SettingsSheet = ({
32807
32973
  )
32808
32974
  ] })
32809
32975
  ] }),
32810
- documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32976
+ documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32811
32977
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32812
- import_react_native16.Text,
32978
+ import_react_native17.Text,
32813
32979
  {
32814
32980
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32815
32981
  children: t.layout
32816
32982
  }
32817
32983
  ),
32818
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
32984
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32819
32985
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32820
- import_react_native16.Pressable,
32986
+ import_react_native17.Pressable,
32821
32987
  {
32822
32988
  onPress: () => handleLayout("single"),
32823
32989
  style: [
@@ -32827,7 +32993,7 @@ var SettingsSheet = ({
32827
32993
  !isDouble && { backgroundColor: accentColor }
32828
32994
  ],
32829
32995
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32830
- import_react_native16.Text,
32996
+ import_react_native17.Text,
32831
32997
  {
32832
32998
  style: [
32833
32999
  styles15.optionText,
@@ -32840,7 +33006,7 @@ var SettingsSheet = ({
32840
33006
  }
32841
33007
  ),
32842
33008
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32843
- import_react_native16.Pressable,
33009
+ import_react_native17.Pressable,
32844
33010
  {
32845
33011
  onPress: () => handleLayout("double"),
32846
33012
  style: [
@@ -32850,7 +33016,7 @@ var SettingsSheet = ({
32850
33016
  isDouble && { backgroundColor: accentColor }
32851
33017
  ],
32852
33018
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32853
- import_react_native16.Text,
33019
+ import_react_native17.Text,
32854
33020
  {
32855
33021
  style: [
32856
33022
  styles15.optionText,
@@ -32864,22 +33030,22 @@ var SettingsSheet = ({
32864
33030
  )
32865
33031
  ] })
32866
33032
  ] }),
32867
- documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
33033
+ documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32868
33034
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32869
- import_react_native16.Text,
33035
+ import_react_native17.Text,
32870
33036
  {
32871
33037
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32872
33038
  children: t.rotate
32873
33039
  }
32874
33040
  ),
32875
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
33041
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32876
33042
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32877
- import_react_native16.Pressable,
33043
+ import_react_native17.Pressable,
32878
33044
  {
32879
33045
  onPress: () => handleRotate("counterclockwise"),
32880
33046
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32881
33047
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32882
- import_react_native16.Text,
33048
+ import_react_native17.Text,
32883
33049
  {
32884
33050
  style: [styles15.optionText, isDark && styles15.optionTextDark],
32885
33051
  children: t.counterclockwise
@@ -32887,13 +33053,13 @@ var SettingsSheet = ({
32887
33053
  )
32888
33054
  }
32889
33055
  ),
32890
- import_react_native16.Platform.OS === "ios" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32891
- import_react_native16.Pressable,
33056
+ import_react_native17.Platform.OS === "ios" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
33057
+ import_react_native17.Pressable,
32892
33058
  {
32893
33059
  onPress: handleResetRotation,
32894
33060
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32895
33061
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32896
- import_react_native16.Text,
33062
+ import_react_native17.Text,
32897
33063
  {
32898
33064
  style: [styles15.optionText, isDark && styles15.optionTextDark],
32899
33065
  children: t.rotationOriginal
@@ -32902,12 +33068,12 @@ var SettingsSheet = ({
32902
33068
  }
32903
33069
  ),
32904
33070
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32905
- import_react_native16.Pressable,
33071
+ import_react_native17.Pressable,
32906
33072
  {
32907
33073
  onPress: () => handleRotate("clockwise"),
32908
33074
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32909
33075
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32910
- import_react_native16.Text,
33076
+ import_react_native17.Text,
32911
33077
  {
32912
33078
  style: [styles15.optionText, isDark && styles15.optionTextDark],
32913
33079
  children: t.clockwise
@@ -32917,29 +33083,29 @@ var SettingsSheet = ({
32917
33083
  )
32918
33084
  ] })
32919
33085
  ] }),
32920
- documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
33086
+ documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32921
33087
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32922
- import_react_native16.Text,
33088
+ import_react_native17.Text,
32923
33089
  {
32924
33090
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32925
33091
  children: t.zoom
32926
33092
  }
32927
33093
  ),
32928
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
33094
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32929
33095
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32930
- import_react_native16.Pressable,
33096
+ import_react_native17.Pressable,
32931
33097
  {
32932
33098
  onPress: () => handleZoom(-0.1),
32933
33099
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32934
33100
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconZoomOut, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
32935
33101
  }
32936
33102
  ),
32937
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.zoomValue, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.Text, { style: [styles15.zoomText, isDark && styles15.zoomTextDark], children: [
33103
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.zoomValue, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.Text, { style: [styles15.zoomText, isDark && styles15.zoomTextDark], children: [
32938
33104
  Math.round(zoom * 100),
32939
33105
  "%"
32940
33106
  ] }) }),
32941
33107
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32942
- import_react_native16.Pressable,
33108
+ import_react_native17.Pressable,
32943
33109
  {
32944
33110
  onPress: () => handleZoom(0.1),
32945
33111
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
@@ -32948,17 +33114,17 @@ var SettingsSheet = ({
32948
33114
  )
32949
33115
  ] })
32950
33116
  ] }),
32951
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
33117
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32952
33118
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32953
- import_react_native16.Text,
33119
+ import_react_native17.Text,
32954
33120
  {
32955
33121
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32956
33122
  children: t.language
32957
33123
  }
32958
33124
  ),
32959
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
33125
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32960
33126
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32961
- import_react_native16.Pressable,
33127
+ import_react_native17.Pressable,
32962
33128
  {
32963
33129
  onPress: () => setDocumentState({ locale: "en" }),
32964
33130
  style: [
@@ -32968,7 +33134,7 @@ var SettingsSheet = ({
32968
33134
  locale === "en" && { backgroundColor: accentColor }
32969
33135
  ],
32970
33136
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32971
- import_react_native16.Text,
33137
+ import_react_native17.Text,
32972
33138
  {
32973
33139
  style: [
32974
33140
  styles15.optionText,
@@ -32981,7 +33147,7 @@ var SettingsSheet = ({
32981
33147
  }
32982
33148
  ),
32983
33149
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32984
- import_react_native16.Pressable,
33150
+ import_react_native17.Pressable,
32985
33151
  {
32986
33152
  onPress: () => setDocumentState({ locale: "pt-BR" }),
32987
33153
  style: [
@@ -32991,7 +33157,7 @@ var SettingsSheet = ({
32991
33157
  locale === "pt-BR" && { backgroundColor: accentColor }
32992
33158
  ],
32993
33159
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32994
- import_react_native16.Text,
33160
+ import_react_native17.Text,
32995
33161
  {
32996
33162
  style: [
32997
33163
  styles15.optionText,
@@ -33011,7 +33177,7 @@ var SettingsSheet = ({
33011
33177
  }
33012
33178
  );
33013
33179
  };
33014
- var styles15 = import_react_native16.StyleSheet.create({
33180
+ var styles15 = import_react_native17.StyleSheet.create({
33015
33181
  sheet: {
33016
33182
  maxHeight: "100%"
33017
33183
  },
@@ -33144,8 +33310,8 @@ var styles15 = import_react_native16.StyleSheet.create({
33144
33310
  var SettingsSheet_default = SettingsSheet;
33145
33311
 
33146
33312
  // components/CoverPreview.tsx
33147
- var import_react16 = require("react");
33148
- var import_react_native17 = require("react-native");
33313
+ var import_react17 = require("react");
33314
+ var import_react_native18 = require("react-native");
33149
33315
  var import_engine_native8 = require("@papyrus-sdk/engine-native");
33150
33316
  var import_jsx_runtime20 = require("react/jsx-runtime");
33151
33317
  var parseDataUri = (value) => {
@@ -33195,18 +33361,18 @@ var CoverPreview = ({
33195
33361
  onLoadEnd,
33196
33362
  onError
33197
33363
  }) => {
33198
- const [engine, setEngine] = (0, import_react16.useState)(null);
33199
- const [layoutReady, setLayoutReady] = (0, import_react16.useState)(false);
33200
- const [loaded, setLoaded] = (0, import_react16.useState)(false);
33201
- const [loading, setLoading] = (0, import_react16.useState)(false);
33202
- const [error, setError] = (0, import_react16.useState)(null);
33203
- const viewRef = (0, import_react16.useRef)(null);
33204
- const resolvedType = (0, import_react16.useMemo)(() => inferDocumentType(source, type), [source, type]);
33364
+ const [engine, setEngine] = (0, import_react17.useState)(null);
33365
+ const [layoutReady, setLayoutReady] = (0, import_react17.useState)(false);
33366
+ const [loaded, setLoaded] = (0, import_react17.useState)(false);
33367
+ const [loading, setLoading] = (0, import_react17.useState)(false);
33368
+ const [error, setError] = (0, import_react17.useState)(null);
33369
+ const viewRef = (0, import_react17.useRef)(null);
33370
+ const resolvedType = (0, import_react17.useMemo)(() => inferDocumentType(source, type), [source, type]);
33205
33371
  const isPdf = resolvedType === "pdf";
33206
- const hasNativePageView = Boolean(import_react_native17.UIManager.getViewManagerConfig?.("PapyrusPageView"));
33372
+ const hasNativePageView = Boolean(import_react_native18.UIManager.getViewManagerConfig?.("PapyrusPageView"));
33207
33373
  const canRender = !isPdf || hasNativePageView;
33208
33374
  const shouldRender = Boolean(visible);
33209
- (0, import_react16.useEffect)(() => {
33375
+ (0, import_react17.useEffect)(() => {
33210
33376
  if (!shouldRender) {
33211
33377
  if (!keepAlive) {
33212
33378
  setEngine(null);
@@ -33219,7 +33385,7 @@ var CoverPreview = ({
33219
33385
  setEngine(new import_engine_native8.MobileDocumentEngine());
33220
33386
  }
33221
33387
  }, [shouldRender, keepAlive, engine, canRender]);
33222
- (0, import_react16.useEffect)(() => {
33388
+ (0, import_react17.useEffect)(() => {
33223
33389
  if (!engine || !shouldRender || !canRender) return;
33224
33390
  let active = true;
33225
33391
  setLoading(true);
@@ -33246,13 +33412,13 @@ var CoverPreview = ({
33246
33412
  active = false;
33247
33413
  };
33248
33414
  }, [engine, shouldRender, canRender, source, type, pageIndex, isPdf, onLoadStart, onLoadEnd, onError]);
33249
- (0, import_react16.useEffect)(() => {
33415
+ (0, import_react17.useEffect)(() => {
33250
33416
  if (!engine || !isPdf || !loaded || !layoutReady || !shouldRender || !canRender) return;
33251
- const viewTag = (0, import_react_native17.findNodeHandle)(viewRef.current);
33417
+ const viewTag = (0, import_react_native18.findNodeHandle)(viewRef.current);
33252
33418
  if (!viewTag) return;
33253
33419
  engine.renderPage(pageIndex, viewTag, renderScale);
33254
33420
  }, [engine, isPdf, loaded, layoutReady, shouldRender, canRender, pageIndex, renderScale]);
33255
- (0, import_react16.useEffect)(() => {
33421
+ (0, import_react17.useEffect)(() => {
33256
33422
  return () => {
33257
33423
  engine?.destroy();
33258
33424
  };
@@ -33264,15 +33430,15 @@ var CoverPreview = ({
33264
33430
  }
33265
33431
  };
33266
33432
  if (!shouldRender || !canRender) {
33267
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.View, { style: [styles16.container, style], children: placeholder ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.View, { style: styles16.placeholder, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.Text, { style: styles16.placeholderText, children: "Preview" }) }) });
33433
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.View, { style: [styles16.container, style], children: placeholder ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.View, { style: styles16.placeholder, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.Text, { style: styles16.placeholderText, children: "Preview" }) }) });
33268
33434
  }
33269
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native17.View, { style: [styles16.container, style], onLayout: handleLayout, children: [
33270
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.View, { style: styles16.previewFrame, pointerEvents: allowInteraction ? "auto" : "none", children: isPdf ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_engine_native8.PapyrusPageView, { ref: viewRef, style: styles16.pageView }) : engine && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WebViewViewer_default, { engine }) }),
33271
- showLoading && loading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.View, { pointerEvents: "none", style: styles16.loadingOverlay, children: loadingIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.ActivityIndicator, { size: "small", color: "#2563eb" }) }),
33272
- error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.View, { pointerEvents: "none", style: styles16.errorOverlay, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.Text, { style: styles16.errorText, children: "Preview unavailable" }) })
33435
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native18.View, { style: [styles16.container, style], onLayout: handleLayout, children: [
33436
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.View, { style: styles16.previewFrame, pointerEvents: allowInteraction ? "auto" : "none", children: isPdf ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_engine_native8.PapyrusPageView, { ref: viewRef, style: styles16.pageView }) : engine && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WebViewViewer_default, { engine }) }),
33437
+ showLoading && loading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.View, { pointerEvents: "none", style: styles16.loadingOverlay, children: loadingIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.ActivityIndicator, { size: "small", color: "#2563eb" }) }),
33438
+ error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.View, { pointerEvents: "none", style: styles16.errorOverlay, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native18.Text, { style: styles16.errorText, children: "Preview unavailable" }) })
33273
33439
  ] });
33274
33440
  };
33275
- var styles16 = import_react_native17.StyleSheet.create({
33441
+ var styles16 = import_react_native18.StyleSheet.create({
33276
33442
  container: {
33277
33443
  backgroundColor: "#f8fafc",
33278
33444
  borderRadius: 12,
@@ -33288,13 +33454,13 @@ var styles16 = import_react_native17.StyleSheet.create({
33288
33454
  backgroundColor: "transparent"
33289
33455
  },
33290
33456
  loadingOverlay: {
33291
- ...import_react_native17.StyleSheet.absoluteFillObject,
33457
+ ...import_react_native18.StyleSheet.absoluteFillObject,
33292
33458
  alignItems: "center",
33293
33459
  justifyContent: "center",
33294
33460
  backgroundColor: "rgba(15, 23, 42, 0.15)"
33295
33461
  },
33296
33462
  errorOverlay: {
33297
- ...import_react_native17.StyleSheet.absoluteFillObject,
33463
+ ...import_react_native18.StyleSheet.absoluteFillObject,
33298
33464
  alignItems: "center",
33299
33465
  justifyContent: "center",
33300
33466
  backgroundColor: "rgba(15, 23, 42, 0.4)"
@@ -33319,19 +33485,19 @@ var styles16 = import_react_native17.StyleSheet.create({
33319
33485
  var CoverPreview_default = CoverPreview;
33320
33486
 
33321
33487
  // components/ReadingShell.tsx
33322
- var import_react19 = __toESM(require("react"));
33323
- var import_react_native24 = require("react-native");
33324
- var import_core20 = require("@papyrus-sdk/core");
33488
+ var import_react20 = __toESM(require("react"));
33489
+ var import_react_native25 = require("react-native");
33490
+ var import_core21 = require("@papyrus-sdk/core");
33325
33491
 
33326
33492
  // components/DocumentActionsSheet.tsx
33327
- var import_react_native18 = require("react-native");
33328
- var import_core14 = require("@papyrus-sdk/core");
33493
+ var import_react_native19 = require("react-native");
33494
+ var import_core15 = require("@papyrus-sdk/core");
33329
33495
  var import_jsx_runtime21 = require("react/jsx-runtime");
33330
33496
  function DocumentActionsSheet({
33331
33497
  visible,
33332
33498
  onClose
33333
33499
  }) {
33334
- const { uiTheme } = (0, import_core14.useViewerStore)();
33500
+ const { uiTheme } = (0, import_core15.useViewerStore)();
33335
33501
  const isDark = uiTheme === "dark";
33336
33502
  const palette = getReaderSheetPalette(isDark);
33337
33503
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -33350,9 +33516,9 @@ function DocumentActionsSheet({
33350
33516
  backgroundColor: palette.surface,
33351
33517
  borderTopColor: palette.divider
33352
33518
  },
33353
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native18.View, { style: styles17.actionList, children: [
33519
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native19.View, { style: styles17.actionList, children: [
33354
33520
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
33355
- import_react_native18.View,
33521
+ import_react_native19.View,
33356
33522
  {
33357
33523
  style: [
33358
33524
  styles17.actionItem,
@@ -33361,11 +33527,11 @@ function DocumentActionsSheet({
33361
33527
  borderColor: palette.divider
33362
33528
  }
33363
33529
  ],
33364
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native18.Text, { style: [styles17.actionText, { color: palette.text }], children: "Share" })
33530
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native19.Text, { style: [styles17.actionText, { color: palette.text }], children: "Share" })
33365
33531
  }
33366
33532
  ),
33367
33533
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
33368
- import_react_native18.View,
33534
+ import_react_native19.View,
33369
33535
  {
33370
33536
  style: [
33371
33537
  styles17.actionItem,
@@ -33374,14 +33540,14 @@ function DocumentActionsSheet({
33374
33540
  borderColor: palette.divider
33375
33541
  }
33376
33542
  ],
33377
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native18.Text, { style: [styles17.actionText, { color: palette.text }], children: "Export" })
33543
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native19.Text, { style: [styles17.actionText, { color: palette.text }], children: "Export" })
33378
33544
  }
33379
33545
  )
33380
33546
  ] })
33381
33547
  }
33382
33548
  );
33383
33549
  }
33384
- var styles17 = import_react_native18.StyleSheet.create({
33550
+ var styles17 = import_react_native19.StyleSheet.create({
33385
33551
  actionList: {
33386
33552
  gap: 10
33387
33553
  },
@@ -33399,8 +33565,8 @@ var styles17 = import_react_native18.StyleSheet.create({
33399
33565
  });
33400
33566
 
33401
33567
  // components/InfoSheet.tsx
33402
- var import_react_native19 = require("react-native");
33403
- var import_core15 = require("@papyrus-sdk/core");
33568
+ var import_react_native20 = require("react-native");
33569
+ var import_core16 = require("@papyrus-sdk/core");
33404
33570
 
33405
33571
  // components/infoSheetModel.ts
33406
33572
  var roundPercent = (value) => Math.max(0, Math.min(100, Math.round(value)));
@@ -33515,7 +33681,7 @@ function InfoSheet({
33515
33681
  viewMode,
33516
33682
  pageTheme,
33517
33683
  locale
33518
- } = (0, import_core15.useViewerStore)();
33684
+ } = (0, import_core16.useViewerStore)();
33519
33685
  const isDark = uiTheme === "dark";
33520
33686
  const palette = getReaderSheetPalette(isDark);
33521
33687
  const isPortuguese = locale === "pt-BR";
@@ -33546,22 +33712,22 @@ function InfoSheet({
33546
33712
  backgroundColor: palette.surface,
33547
33713
  borderTopColor: palette.divider
33548
33714
  },
33549
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native19.View, { style: styles18.sheet, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
33715
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.View, { style: styles18.sheet, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
33550
33716
  NativeSheetScrollView,
33551
33717
  {
33552
33718
  style: styles18.content,
33553
33719
  contentContainerStyle: styles18.contentInner,
33554
33720
  showsVerticalScrollIndicator: false,
33555
33721
  children: [
33556
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native19.Text, { style: [styles18.sectionTitle, { color: palette.mutedText }], children: isPortuguese ? "Resumo do documento" : "Document summary" }),
33557
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native19.View, { style: [styles18.rows, { borderTopColor: palette.divider }], children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
33558
- import_react_native19.View,
33722
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.Text, { style: [styles18.sectionTitle, { color: palette.mutedText }], children: isPortuguese ? "Resumo do documento" : "Document summary" }),
33723
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.View, { style: [styles18.rows, { borderTopColor: palette.divider }], children: rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
33724
+ import_react_native20.View,
33559
33725
  {
33560
33726
  style: [styles18.row, { borderBottomColor: palette.divider }],
33561
33727
  children: [
33562
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native19.Text, { style: [styles18.label, { color: palette.mutedText }], children: row.label }),
33728
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.Text, { style: [styles18.label, { color: palette.mutedText }], children: row.label }),
33563
33729
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
33564
- import_react_native19.Text,
33730
+ import_react_native20.Text,
33565
33731
  {
33566
33732
  style: [styles18.value, { color: palette.text }],
33567
33733
  selectable: true,
@@ -33578,7 +33744,7 @@ function InfoSheet({
33578
33744
  }
33579
33745
  );
33580
33746
  }
33581
- var styles18 = import_react_native19.StyleSheet.create({
33747
+ var styles18 = import_react_native20.StyleSheet.create({
33582
33748
  sheet: {
33583
33749
  flex: 1,
33584
33750
  paddingBottom: 16
@@ -33624,8 +33790,8 @@ var styles18 = import_react_native19.StyleSheet.create({
33624
33790
  });
33625
33791
 
33626
33792
  // components/OverflowSheet.tsx
33627
- var import_react_native20 = require("react-native");
33628
- var import_core16 = require("@papyrus-sdk/core");
33793
+ var import_react_native21 = require("react-native");
33794
+ var import_core17 = require("@papyrus-sdk/core");
33629
33795
  var import_jsx_runtime23 = require("react/jsx-runtime");
33630
33796
  var actionLabels = [{ key: "actions", label: "Document actions" }];
33631
33797
  function OverflowSheet({
@@ -33633,7 +33799,7 @@ function OverflowSheet({
33633
33799
  onClose,
33634
33800
  onOpenActions
33635
33801
  }) {
33636
- const isDark = (0, import_core16.useViewerStore)((state) => state.uiTheme === "dark");
33802
+ const isDark = (0, import_core17.useViewerStore)((state) => state.uiTheme === "dark");
33637
33803
  const palette = getReaderSheetPalette(isDark);
33638
33804
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
33639
33805
  NativeSheet,
@@ -33651,8 +33817,8 @@ function OverflowSheet({
33651
33817
  backgroundColor: palette.surface,
33652
33818
  borderTopColor: palette.divider
33653
33819
  },
33654
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native20.View, { style: styles19.actionList, children: actionLabels.map((action) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
33655
- import_react_native20.Pressable,
33820
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native21.View, { style: styles19.actionList, children: actionLabels.map((action) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
33821
+ import_react_native21.Pressable,
33656
33822
  {
33657
33823
  onPress: onOpenActions,
33658
33824
  style: [
@@ -33664,14 +33830,14 @@ function OverflowSheet({
33664
33830
  ],
33665
33831
  accessibilityRole: "button",
33666
33832
  accessibilityLabel: action.label,
33667
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native20.Text, { style: [styles19.actionText, { color: palette.text }], children: action.label })
33833
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native21.Text, { style: [styles19.actionText, { color: palette.text }], children: action.label })
33668
33834
  },
33669
33835
  action.key
33670
33836
  )) })
33671
33837
  }
33672
33838
  );
33673
33839
  }
33674
- var styles19 = import_react_native20.StyleSheet.create({
33840
+ var styles19 = import_react_native21.StyleSheet.create({
33675
33841
  actionList: { gap: 10 },
33676
33842
  actionButton: {
33677
33843
  borderWidth: 1,
@@ -33683,9 +33849,9 @@ var styles19 = import_react_native20.StyleSheet.create({
33683
33849
  });
33684
33850
 
33685
33851
  // components/ProgressPill.tsx
33686
- var import_react17 = require("react");
33687
- var import_react_native21 = require("react-native");
33688
- var import_core17 = require("@papyrus-sdk/core");
33852
+ var import_react18 = require("react");
33853
+ var import_react_native22 = require("react-native");
33854
+ var import_core18 = require("@papyrus-sdk/core");
33689
33855
 
33690
33856
  // components/progressPillMode.ts
33691
33857
  function resolveProgressPillMode(viewMode, currentPage, pageCount) {
@@ -33721,12 +33887,12 @@ function ProgressPill({
33721
33887
  accentColor,
33722
33888
  mobileChromeVisible,
33723
33889
  mobileProgressPillVisible
33724
- } = (0, import_core17.useViewerStore)();
33890
+ } = (0, import_core18.useViewerStore)();
33725
33891
  const t = getStrings(locale);
33726
33892
  const isDark = uiTheme === "dark";
33727
33893
  const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
33728
- const { height: windowHeight } = (0, import_react_native21.useWindowDimensions)();
33729
- const windowHeightRef = (0, import_react17.useRef)(windowHeight);
33894
+ const { height: windowHeight } = (0, import_react_native22.useWindowDimensions)();
33895
+ const windowHeightRef = (0, import_react18.useRef)(windowHeight);
33730
33896
  windowHeightRef.current = windowHeight;
33731
33897
  const trackHeight = resolvePageScrubberTrackHeight({
33732
33898
  windowHeight,
@@ -33734,32 +33900,32 @@ function ProgressPill({
33734
33900
  bottomOffset: offsets.bottom
33735
33901
  });
33736
33902
  const thumbHeight = 44;
33737
- const trackYRef = (0, import_react17.useRef)(0);
33738
- const scrubberRef = (0, import_react17.useRef)(null);
33739
- const currentPageRef = (0, import_react17.useRef)(currentPage);
33903
+ const trackYRef = (0, import_react18.useRef)(0);
33904
+ const scrubberRef = (0, import_react18.useRef)(null);
33905
+ const currentPageRef = (0, import_react18.useRef)(currentPage);
33740
33906
  currentPageRef.current = currentPage;
33741
- const isScrubbingRef = (0, import_react17.useRef)(false);
33742
- const hasMovedRef = (0, import_react17.useRef)(false);
33743
- const longPressTriggeredRef = (0, import_react17.useRef)(false);
33744
- const longPressTimerRef = (0, import_react17.useRef)(null);
33745
- const pendingReleasedScrubPageRef = (0, import_react17.useRef)(null);
33746
- const [scrubPreviewPage, setScrubPreviewPage] = (0, import_react17.useState)(null);
33747
- const onNavigateToPageRef = (0, import_react17.useRef)(onNavigateToPage);
33748
- const onPressRef = (0, import_react17.useRef)(onPress);
33749
- const onOpenPageJumpRef = (0, import_react17.useRef)(onOpenPageJump);
33750
- const onScrubbingChangeRef = (0, import_react17.useRef)(onScrubbingChange);
33907
+ const isScrubbingRef = (0, import_react18.useRef)(false);
33908
+ const hasMovedRef = (0, import_react18.useRef)(false);
33909
+ const longPressTriggeredRef = (0, import_react18.useRef)(false);
33910
+ const longPressTimerRef = (0, import_react18.useRef)(null);
33911
+ const pendingReleasedScrubPageRef = (0, import_react18.useRef)(null);
33912
+ const [scrubPreviewPage, setScrubPreviewPage] = (0, import_react18.useState)(null);
33913
+ const onNavigateToPageRef = (0, import_react18.useRef)(onNavigateToPage);
33914
+ const onPressRef = (0, import_react18.useRef)(onPress);
33915
+ const onOpenPageJumpRef = (0, import_react18.useRef)(onOpenPageJump);
33916
+ const onScrubbingChangeRef = (0, import_react18.useRef)(onScrubbingChange);
33751
33917
  onScrubbingChangeRef.current = onScrubbingChange;
33752
- const scrubToPositionRef = (0, import_react17.useRef)(() => {
33918
+ const scrubToPositionRef = (0, import_react18.useRef)(() => {
33753
33919
  });
33754
- const scrubNavigationControllerRef = (0, import_react17.useRef)(
33920
+ const scrubNavigationControllerRef = (0, import_react18.useRef)(
33755
33921
  createPageScrubberNavigationController((page) => {
33756
33922
  onNavigateToPageRef.current?.(page);
33757
33923
  })
33758
33924
  );
33759
- const scrubberResponderRef = (0, import_react17.useRef)(null);
33925
+ const scrubberResponderRef = (0, import_react18.useRef)(null);
33760
33926
  const touchPolicy = resolvePageScrubberTouchPolicy();
33761
33927
  const displayedPage = scrubPreviewPage ?? currentPage;
33762
- const label = (0, import_react17.useMemo)(() => {
33928
+ const label = (0, import_react18.useMemo)(() => {
33763
33929
  const total = Math.max(pageCount, 1);
33764
33930
  const percent = clampPercent(displayedPage / total * 100);
33765
33931
  if (documentType === "pdf") {
@@ -33776,34 +33942,34 @@ function ProgressPill({
33776
33942
  thumbHeight,
33777
33943
  pageCount
33778
33944
  });
33779
- const thumbTopRef = (0, import_react17.useRef)(new import_react_native21.Animated.Value(thumbTop));
33780
- const thumbTopSnapshotRef = (0, import_react17.useRef)(thumbTop);
33945
+ const thumbTopRef = (0, import_react18.useRef)(new import_react_native22.Animated.Value(thumbTop));
33946
+ const thumbTopSnapshotRef = (0, import_react18.useRef)(thumbTop);
33781
33947
  thumbTopSnapshotRef.current = thumbTop;
33782
- const scrubStartThumbTopRef = (0, import_react17.useRef)(0);
33783
- const trackReveal = (0, import_react17.useRef)(new import_react_native21.Animated.Value(0)).current;
33784
- const [trackOriginY, setTrackOriginY] = (0, import_react17.useState)(0);
33785
- const scrubberMetricsRef = (0, import_react17.useRef)({ trackHeight, thumbHeight, pageCount });
33948
+ const scrubStartThumbTopRef = (0, import_react18.useRef)(0);
33949
+ const trackReveal = (0, import_react18.useRef)(new import_react_native22.Animated.Value(0)).current;
33950
+ const [trackOriginY, setTrackOriginY] = (0, import_react18.useState)(0);
33951
+ const scrubberMetricsRef = (0, import_react18.useRef)({ trackHeight, thumbHeight, pageCount });
33786
33952
  scrubberMetricsRef.current = { trackHeight, thumbHeight, pageCount };
33787
- (0, import_react17.useEffect)(() => {
33953
+ (0, import_react18.useEffect)(() => {
33788
33954
  onNavigateToPageRef.current = onNavigateToPage;
33789
33955
  }, [onNavigateToPage]);
33790
- (0, import_react17.useEffect)(() => {
33956
+ (0, import_react18.useEffect)(() => {
33791
33957
  onPressRef.current = onPress;
33792
33958
  onOpenPageJumpRef.current = onOpenPageJump;
33793
33959
  }, [onOpenPageJump, onPress]);
33794
- (0, import_react17.useEffect)(() => {
33960
+ (0, import_react18.useEffect)(() => {
33795
33961
  const pendingPage = pendingReleasedScrubPageRef.current;
33796
33962
  if (pendingPage !== null && currentPage === pendingPage) {
33797
33963
  pendingReleasedScrubPageRef.current = null;
33798
33964
  setScrubPreviewPage(null);
33799
33965
  }
33800
33966
  }, [currentPage]);
33801
- (0, import_react17.useEffect)(() => {
33967
+ (0, import_react18.useEffect)(() => {
33802
33968
  if (!isScrubbingRef.current) {
33803
33969
  thumbTopRef.current.setValue(thumbTop);
33804
33970
  }
33805
33971
  }, [thumbTop, thumbTopRef]);
33806
- (0, import_react17.useEffect)(
33972
+ (0, import_react18.useEffect)(
33807
33973
  () => () => {
33808
33974
  if (longPressTimerRef.current !== null) {
33809
33975
  clearTimeout(longPressTimerRef.current);
@@ -33821,19 +33987,19 @@ function ProgressPill({
33821
33987
  if (documentType === "text") {
33822
33988
  const progress = textLength <= 0 ? 0 : clampPercent(currentTextOffset / textLength * 100);
33823
33989
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33824
- import_react_native21.View,
33990
+ import_react_native22.View,
33825
33991
  {
33826
33992
  pointerEvents: "box-none",
33827
33993
  style: [styles20.frame, styles20.singleFrame, { top: offsets.progress, right: offsets.right }],
33828
33994
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33829
- import_react_native21.Pressable,
33995
+ import_react_native22.Pressable,
33830
33996
  {
33831
33997
  accessibilityRole: "button",
33832
33998
  accessibilityLabel: `${t.progress} ${progress}%`,
33833
33999
  onPress: () => onPressRef.current(),
33834
34000
  style: [styles20.singlePill, isDark && styles20.pillDark],
33835
34001
  testID: "papyrus-progress-text",
33836
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native21.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
34002
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
33837
34003
  progress,
33838
34004
  "%"
33839
34005
  ] })
@@ -33848,13 +34014,13 @@ function ProgressPill({
33848
34014
  const previousDisabled = pillMode.previousPage === null || !onNavigateToPage;
33849
34015
  const nextDisabled = pillMode.nextPage === null || !onNavigateToPage;
33850
34016
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33851
- import_react_native21.View,
34017
+ import_react_native22.View,
33852
34018
  {
33853
34019
  pointerEvents: "box-none",
33854
34020
  style: [styles20.frame, styles20.singleFrame, { top: offsets.progress, right: offsets.right }],
33855
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native21.View, { style: [styles20.singlePill, isDark && styles20.pillDark], children: [
34021
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.View, { style: [styles20.singlePill, isDark && styles20.pillDark], children: [
33856
34022
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33857
- import_react_native21.Pressable,
34023
+ import_react_native22.Pressable,
33858
34024
  {
33859
34025
  accessibilityRole: "button",
33860
34026
  accessibilityLabel: t.previousPage,
@@ -33863,18 +34029,18 @@ function ProgressPill({
33863
34029
  onPress: () => pillMode.previousPage !== null && onNavigateToPageRef.current?.(pillMode.previousPage),
33864
34030
  style: styles20.pageArrowHit,
33865
34031
  testID: "papyrus-progress-page-previous",
33866
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native21.Text, { style: [styles20.pageArrow, isDark && styles20.labelDark, previousDisabled && styles20.pageArrowDisabled], children: "\u2039" })
34032
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: [styles20.pageArrow, isDark && styles20.labelDark, previousDisabled && styles20.pageArrowDisabled], children: "\u2039" })
33867
34033
  }
33868
34034
  ),
33869
34035
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33870
- import_react_native21.Pressable,
34036
+ import_react_native22.Pressable,
33871
34037
  {
33872
34038
  accessibilityRole: "button",
33873
34039
  accessibilityLabel: `${currentPage}/${pageCount || 0}`,
33874
34040
  onPress: () => onPressRef.current(),
33875
34041
  style: styles20.singlePageCenter,
33876
34042
  testID: "papyrus-progress-page-grid",
33877
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native21.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
34043
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
33878
34044
  currentPage,
33879
34045
  "/",
33880
34046
  pageCount || 0
@@ -33882,7 +34048,7 @@ function ProgressPill({
33882
34048
  }
33883
34049
  ),
33884
34050
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33885
- import_react_native21.Pressable,
34051
+ import_react_native22.Pressable,
33886
34052
  {
33887
34053
  accessibilityRole: "button",
33888
34054
  accessibilityLabel: t.nextPage,
@@ -33891,7 +34057,7 @@ function ProgressPill({
33891
34057
  onPress: () => pillMode.nextPage !== null && onNavigateToPageRef.current?.(pillMode.nextPage),
33892
34058
  style: styles20.pageArrowHit,
33893
34059
  testID: "papyrus-progress-page-next",
33894
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native21.Text, { style: [styles20.pageArrow, isDark && styles20.labelDark, nextDisabled && styles20.pageArrowDisabled], children: "\u203A" })
34060
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: [styles20.pageArrow, isDark && styles20.labelDark, nextDisabled && styles20.pageArrowDisabled], children: "\u203A" })
33895
34061
  }
33896
34062
  )
33897
34063
  ] })
@@ -33918,7 +34084,7 @@ function ProgressPill({
33918
34084
  };
33919
34085
  scrubToPositionRef.current = scrubToPosition;
33920
34086
  if (scrubberResponderRef.current === null) {
33921
- scrubberResponderRef.current = import_react_native21.PanResponder.create({
34087
+ scrubberResponderRef.current = import_react_native22.PanResponder.create({
33922
34088
  onStartShouldSetPanResponder: () => touchPolicy.claimOnStart,
33923
34089
  onStartShouldSetPanResponderCapture: () => touchPolicy.captureOnStart,
33924
34090
  onMoveShouldSetPanResponder: () => true,
@@ -33938,7 +34104,7 @@ function ProgressPill({
33938
34104
  })
33939
34105
  );
33940
34106
  trackReveal.setValue(0);
33941
- import_react_native21.Animated.timing(trackReveal, {
34107
+ import_react_native22.Animated.timing(trackReveal, {
33942
34108
  toValue: 1,
33943
34109
  duration: 180,
33944
34110
  useNativeDriver: false
@@ -33984,7 +34150,7 @@ function ProgressPill({
33984
34150
  }
33985
34151
  isScrubbingRef.current = false;
33986
34152
  onScrubbingChangeRef.current?.(false);
33987
- import_react_native21.Animated.timing(trackReveal, {
34153
+ import_react_native22.Animated.timing(trackReveal, {
33988
34154
  toValue: 0,
33989
34155
  duration: 140,
33990
34156
  useNativeDriver: false
@@ -34016,7 +34182,7 @@ function ProgressPill({
34016
34182
  }
34017
34183
  isScrubbingRef.current = false;
34018
34184
  onScrubbingChangeRef.current?.(false);
34019
- import_react_native21.Animated.timing(trackReveal, {
34185
+ import_react_native22.Animated.timing(trackReveal, {
34020
34186
  toValue: 0,
34021
34187
  duration: 140,
34022
34188
  useNativeDriver: false
@@ -34032,7 +34198,7 @@ function ProgressPill({
34032
34198
  }
34033
34199
  const responderPanHandlers = scrubberResponderRef.current?.panHandlers ?? {};
34034
34200
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34035
- import_react_native21.View,
34201
+ import_react_native22.View,
34036
34202
  {
34037
34203
  pointerEvents: "box-none",
34038
34204
  style: [
@@ -34044,7 +34210,7 @@ function ProgressPill({
34044
34210
  }
34045
34211
  ],
34046
34212
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
34047
- import_react_native21.View,
34213
+ import_react_native22.View,
34048
34214
  {
34049
34215
  ref: scrubberRef,
34050
34216
  pointerEvents: resolvePageScrubberPointerEvents(),
@@ -34056,7 +34222,7 @@ function ProgressPill({
34056
34222
  },
34057
34223
  children: [
34058
34224
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34059
- import_react_native21.Animated.View,
34225
+ import_react_native22.Animated.View,
34060
34226
  {
34061
34227
  pointerEvents: "none",
34062
34228
  style: [
@@ -34072,12 +34238,12 @@ function ProgressPill({
34072
34238
  }
34073
34239
  ),
34074
34240
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34075
- import_react_native21.Animated.View,
34241
+ import_react_native22.Animated.View,
34076
34242
  {
34077
34243
  pointerEvents: "box-none",
34078
34244
  style: [styles20.thumb, { top: thumbTopRef.current }],
34079
34245
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
34080
- import_react_native21.View,
34246
+ import_react_native22.View,
34081
34247
  {
34082
34248
  style: [
34083
34249
  styles20.pill,
@@ -34087,8 +34253,8 @@ function ProgressPill({
34087
34253
  ...responderPanHandlers,
34088
34254
  testID: "papyrus-progress-pill",
34089
34255
  children: [
34090
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native21.View, { style: styles20.labelHit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native21.Text, { style: [styles20.label, isDark && styles20.labelDark], children: label }) }),
34091
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native21.View, { style: styles20.iconHit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34256
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.View, { style: styles20.labelHit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: [styles20.label, isDark && styles20.labelDark], children: label }) }),
34257
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.View, { style: styles20.iconHit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34092
34258
  IconPageNav,
34093
34259
  {
34094
34260
  size: 20,
@@ -34107,7 +34273,7 @@ function ProgressPill({
34107
34273
  }
34108
34274
  );
34109
34275
  }
34110
- var styles20 = import_react_native21.StyleSheet.create({
34276
+ var styles20 = import_react_native22.StyleSheet.create({
34111
34277
  frame: {
34112
34278
  position: "absolute",
34113
34279
  top: 72,
@@ -34213,9 +34379,9 @@ var styles20 = import_react_native21.StyleSheet.create({
34213
34379
  });
34214
34380
 
34215
34381
  // components/SearchOverlay.tsx
34216
- var import_react18 = __toESM(require("react"));
34217
- var import_react_native22 = require("react-native");
34218
- var import_core18 = require("@papyrus-sdk/core");
34382
+ var import_react19 = __toESM(require("react"));
34383
+ var import_react_native23 = require("react-native");
34384
+ var import_core19 = require("@papyrus-sdk/core");
34219
34385
 
34220
34386
  // components/searchOverlayLayout.ts
34221
34387
  var getSearchOverlayLayout = (windowWidth) => {
@@ -34256,23 +34422,23 @@ function SearchOverlay({
34256
34422
  setSearch,
34257
34423
  uiTheme,
34258
34424
  accentColor
34259
- } = (0, import_core18.useViewerStore)();
34260
- const [draft, setDraft] = (0, import_react18.useState)(searchQuery);
34261
- const [isSearching, setIsSearching] = (0, import_react18.useState)(false);
34262
- const searchRequestIdRef = import_react18.default.useRef(0);
34425
+ } = (0, import_core19.useViewerStore)();
34426
+ const [draft, setDraft] = (0, import_react19.useState)(searchQuery);
34427
+ const [isSearching, setIsSearching] = (0, import_react19.useState)(false);
34428
+ const searchRequestIdRef = import_react19.default.useRef(0);
34263
34429
  const isDark = uiTheme === "dark";
34264
- const { width: windowWidth } = (0, import_react_native22.useWindowDimensions)();
34430
+ const { width: windowWidth } = (0, import_react_native23.useWindowDimensions)();
34265
34431
  const overlayLayout = getSearchOverlayLayout(windowWidth);
34266
34432
  const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
34267
34433
  const t = getStrings(locale);
34268
- const searchService = (0, import_react18.useMemo)(() => new import_core18.SearchService(engine), [engine]);
34434
+ const searchService = (0, import_react19.useMemo)(() => new import_core19.SearchService(engine), [engine]);
34269
34435
  const results = documentType === "text" ? textSearchResults : searchResults;
34270
- (0, import_react18.useEffect)(() => {
34436
+ (0, import_react19.useEffect)(() => {
34271
34437
  searchService.clearCache();
34272
34438
  }, [isLoaded, pageCount, searchService]);
34273
34439
  const currentCount = results.length > 0 && activeSearchIndex >= 0 ? activeSearchIndex + 1 : 0;
34274
34440
  const targetLabel = documentType === "pdf" ? t.page : documentType === "epub" ? t.contents : t.progress;
34275
- (0, import_react18.useEffect)(() => {
34441
+ (0, import_react19.useEffect)(() => {
34276
34442
  if (!visible) return;
34277
34443
  setDraft(searchQuery);
34278
34444
  }, [searchQuery, visible]);
@@ -34294,13 +34460,13 @@ function SearchOverlay({
34294
34460
  }
34295
34461
  };
34296
34462
  const handleClose = () => {
34297
- import_react_native22.Keyboard.dismiss();
34463
+ import_react_native23.Keyboard.dismiss();
34298
34464
  setSearch("", []);
34299
34465
  onClose();
34300
34466
  };
34301
34467
  if (!visible) return null;
34302
34468
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34303
- import_react_native22.View,
34469
+ import_react_native23.View,
34304
34470
  {
34305
34471
  pointerEvents: "box-none",
34306
34472
  style: [
@@ -34313,16 +34479,16 @@ function SearchOverlay({
34313
34479
  }
34314
34480
  ],
34315
34481
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
34316
- import_react_native22.View,
34482
+ import_react_native23.View,
34317
34483
  {
34318
34484
  style: [styles21.card, overlayLayout.card, isDark && styles21.cardDark],
34319
34485
  testID: "papyrus-search-overlay",
34320
34486
  children: [
34321
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native22.View, { style: styles21.inputRow, children: [
34322
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native22.View, { style: [styles21.searchInputWrap, isDark && styles21.searchInputWrapDark], children: [
34487
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: styles21.inputRow, children: [
34488
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: [styles21.searchInputWrap, isDark && styles21.searchInputWrapDark], children: [
34323
34489
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconSearch, { size: 16, color: isDark ? "#cbd5e1" : "#64748b" }),
34324
34490
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34325
- import_react_native22.TextInput,
34491
+ import_react_native23.TextInput,
34326
34492
  {
34327
34493
  value: draft,
34328
34494
  onChangeText: setDraft,
@@ -34338,18 +34504,18 @@ function SearchOverlay({
34338
34504
  )
34339
34505
  ] }),
34340
34506
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34341
- import_react_native22.Pressable,
34507
+ import_react_native23.Pressable,
34342
34508
  {
34343
34509
  onPress: handleClose,
34344
34510
  style: [styles21.closeButton, isDark && styles21.closeButtonDark],
34345
34511
  accessibilityLabel: "Close search",
34346
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native22.Text, { style: [styles21.closeText, isDark && styles21.closeTextDark], children: t.cancel })
34512
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native23.Text, { style: [styles21.closeText, isDark && styles21.closeTextDark], children: t.cancel })
34347
34513
  }
34348
34514
  )
34349
34515
  ] }),
34350
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native22.View, { style: styles21.metaRow, children: [
34516
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: styles21.metaRow, children: [
34351
34517
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34352
- import_react_native22.Pressable,
34518
+ import_react_native23.Pressable,
34353
34519
  {
34354
34520
  onPress: prevSearchResult,
34355
34521
  disabled: results.length === 0,
@@ -34362,9 +34528,9 @@ function SearchOverlay({
34362
34528
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconChevronLeft, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
34363
34529
  }
34364
34530
  ),
34365
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native22.Text, { style: [styles21.metaText, isDark && styles21.metaTextDark], children: isSearching ? t.searching : `${currentCount}/${results.length} ${targetLabel}` }),
34531
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native23.Text, { style: [styles21.metaText, isDark && styles21.metaTextDark], children: isSearching ? t.searching : `${currentCount}/${results.length} ${targetLabel}` }),
34366
34532
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34367
- import_react_native22.Pressable,
34533
+ import_react_native23.Pressable,
34368
34534
  {
34369
34535
  onPress: nextSearchResult,
34370
34536
  disabled: results.length === 0,
@@ -34378,19 +34544,19 @@ function SearchOverlay({
34378
34544
  }
34379
34545
  )
34380
34546
  ] }),
34381
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native22.View, { style: styles21.actionsRow, children: [
34547
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: styles21.actionsRow, children: [
34382
34548
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34383
- import_react_native22.Pressable,
34549
+ import_react_native23.Pressable,
34384
34550
  {
34385
34551
  onPress: handleSubmit,
34386
34552
  style: [styles21.primaryAction, { backgroundColor: accentColor }],
34387
34553
  accessibilityLabel: "Run search",
34388
34554
  testID: "papyrus-search-run",
34389
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native22.Text, { style: styles21.primaryActionText, children: t.searchGo })
34555
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native23.Text, { style: styles21.primaryActionText, children: t.searchGo })
34390
34556
  }
34391
34557
  ),
34392
34558
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34393
- import_react_native22.Pressable,
34559
+ import_react_native23.Pressable,
34394
34560
  {
34395
34561
  onPress: onOpenResults,
34396
34562
  disabled: results.length === 0,
@@ -34401,7 +34567,7 @@ function SearchOverlay({
34401
34567
  ],
34402
34568
  accessibilityLabel: "Open all results",
34403
34569
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34404
- import_react_native22.Text,
34570
+ import_react_native23.Text,
34405
34571
  {
34406
34572
  style: [
34407
34573
  styles21.secondaryActionText,
@@ -34419,7 +34585,7 @@ function SearchOverlay({
34419
34585
  }
34420
34586
  );
34421
34587
  }
34422
- var styles21 = import_react_native22.StyleSheet.create({
34588
+ var styles21 = import_react_native23.StyleSheet.create({
34423
34589
  frame: {
34424
34590
  position: "absolute",
34425
34591
  left: 0,
@@ -34560,8 +34726,8 @@ var styles21 = import_react_native22.StyleSheet.create({
34560
34726
  });
34561
34727
 
34562
34728
  // components/SearchResultsSheet.tsx
34563
- var import_react_native23 = require("react-native");
34564
- var import_core19 = require("@papyrus-sdk/core");
34729
+ var import_react_native24 = require("react-native");
34730
+ var import_core20 = require("@papyrus-sdk/core");
34565
34731
  var import_jsx_runtime26 = require("react/jsx-runtime");
34566
34732
  function SearchResultsSheet({
34567
34733
  documentType,
@@ -34580,7 +34746,7 @@ function SearchResultsSheet({
34580
34746
  triggerScrollToTextOffset,
34581
34747
  uiTheme,
34582
34748
  accentColor
34583
- } = (0, import_core19.useViewerStore)();
34749
+ } = (0, import_core20.useViewerStore)();
34584
34750
  const results = documentType === "text" ? textSearchResults : searchResults;
34585
34751
  const isDark = uiTheme === "dark";
34586
34752
  const palette = getReaderSheetPalette(isDark);
@@ -34608,16 +34774,16 @@ function SearchResultsSheet({
34608
34774
  borderTopColor: palette.divider
34609
34775
  },
34610
34776
  children: [
34611
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_native23.Text, { style: [styles22.meta, { color: palette.mutedText }], children: [
34777
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_native24.Text, { style: [styles22.meta, { color: palette.mutedText }], children: [
34612
34778
  results.length,
34613
34779
  " ",
34614
34780
  t.results
34615
34781
  ] }),
34616
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NativeSheetScrollView, { contentContainerStyle: styles22.content, children: results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native23.Text, { style: [styles22.emptyText, { color: palette.mutedText }], children: t.noResults }) : results.map((result, index) => {
34782
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NativeSheetScrollView, { contentContainerStyle: styles22.content, children: results.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: [styles22.emptyText, { color: palette.mutedText }], children: t.noResults }) : results.map((result, index) => {
34617
34783
  const isActive = index === activeSearchIndex;
34618
34784
  const isTextResult = "kind" in result && result.kind === "text";
34619
34785
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
34620
- import_react_native23.Pressable,
34786
+ import_react_native24.Pressable,
34621
34787
  {
34622
34788
  onPress: () => {
34623
34789
  if (isTextResult) {
@@ -34643,8 +34809,8 @@ function SearchResultsSheet({
34643
34809
  }
34644
34810
  ],
34645
34811
  children: [
34646
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native23.Text, { style: [styles22.resultLabel, { color: accentColor }], children: isTextResult ? getTextResultLabel(result.location.start) : getResultLabel(result.pageIndex) }),
34647
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native23.Text, { style: [styles22.resultText, { color: palette.text }], children: result.text })
34812
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: [styles22.resultLabel, { color: accentColor }], children: isTextResult ? getTextResultLabel(result.location.start) : getResultLabel(result.pageIndex) }),
34813
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: [styles22.resultText, { color: palette.text }], children: result.text })
34648
34814
  ]
34649
34815
  },
34650
34816
  isTextResult ? `text-${result.location.start}-${index}` : `page-${result.pageIndex}-${index}`
@@ -34654,7 +34820,7 @@ function SearchResultsSheet({
34654
34820
  }
34655
34821
  );
34656
34822
  }
34657
- var styles22 = import_react_native23.StyleSheet.create({
34823
+ var styles22 = import_react_native24.StyleSheet.create({
34658
34824
  meta: { fontSize: 12, paddingHorizontal: 18, marginBottom: 10 },
34659
34825
  content: { paddingHorizontal: 18, paddingBottom: 18, gap: 10 },
34660
34826
  emptyText: { fontSize: 13 },
@@ -34694,20 +34860,20 @@ function ReadingShell({
34694
34860
  pageCount,
34695
34861
  uiTheme,
34696
34862
  accentColor
34697
- } = (0, import_core20.useViewerStore)();
34698
- const [overflowOpen, setOverflowOpen] = (0, import_react19.useState)(false);
34699
- const [infoOpen, setInfoOpen] = (0, import_react19.useState)(false);
34700
- const [actionsOpen, setActionsOpen] = (0, import_react19.useState)(false);
34701
- const [settingsOpen, setSettingsOpen] = (0, import_react19.useState)(false);
34702
- const [searchResultsOpen, setSearchResultsOpen] = (0, import_react19.useState)(false);
34703
- const [pageJumpOpen, setPageJumpOpen] = (0, import_react19.useState)(false);
34704
- const [pageScrubActive, setPageScrubActive] = (0, import_react19.useState)(false);
34863
+ } = (0, import_core21.useViewerStore)();
34864
+ const [overflowOpen, setOverflowOpen] = (0, import_react20.useState)(false);
34865
+ const [infoOpen, setInfoOpen] = (0, import_react20.useState)(false);
34866
+ const [actionsOpen, setActionsOpen] = (0, import_react20.useState)(false);
34867
+ const [settingsOpen, setSettingsOpen] = (0, import_react20.useState)(false);
34868
+ const [searchResultsOpen, setSearchResultsOpen] = (0, import_react20.useState)(false);
34869
+ const [pageJumpOpen, setPageJumpOpen] = (0, import_react20.useState)(false);
34870
+ const [pageScrubActive, setPageScrubActive] = (0, import_react20.useState)(false);
34705
34871
  const isDark = uiTheme === "dark";
34706
- import_react19.default.useEffect(() => {
34707
- const showSubscription = import_react_native24.Keyboard.addListener("keyboardDidShow", () => {
34872
+ import_react20.default.useEffect(() => {
34873
+ const showSubscription = import_react_native25.Keyboard.addListener("keyboardDidShow", () => {
34708
34874
  setMobileKeyboardOpen(true);
34709
34875
  });
34710
- const hideSubscription = import_react_native24.Keyboard.addListener("keyboardDidHide", () => {
34876
+ const hideSubscription = import_react_native25.Keyboard.addListener("keyboardDidHide", () => {
34711
34877
  setMobileKeyboardOpen(false);
34712
34878
  });
34713
34879
  return () => {
@@ -34715,7 +34881,7 @@ function ReadingShell({
34715
34881
  hideSubscription.remove();
34716
34882
  };
34717
34883
  }, [setMobileKeyboardOpen]);
34718
- import_react19.default.useEffect(() => {
34884
+ import_react20.default.useEffect(() => {
34719
34885
  if (sidebarRightOpen) return;
34720
34886
  if (isSidebarBoundDestination(activeMobileDestination)) {
34721
34887
  closeMobileDestination();
@@ -34761,7 +34927,7 @@ function ReadingShell({
34761
34927
  setDocumentState({ currentPage: page });
34762
34928
  triggerScrollToPage(page - 1);
34763
34929
  };
34764
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PapyrusSafeAreaBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react_native24.View, { style: styles23.container, testID: "papyrus-rn-reading-shell", children: [
34930
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PapyrusSafeAreaBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react_native25.View, { style: styles23.container, testID: "papyrus-rn-reading-shell", children: [
34765
34931
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
34766
34932
  Topbar_default,
34767
34933
  {
@@ -34778,7 +34944,7 @@ function ReadingShell({
34778
34944
  showPageNavigationControls: false
34779
34945
  }
34780
34946
  ),
34781
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native24.View, { style: styles23.viewerStage, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
34947
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native25.View, { style: styles23.viewerStage, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
34782
34948
  Viewer_default,
34783
34949
  {
34784
34950
  engine,
@@ -34818,7 +34984,7 @@ function ReadingShell({
34818
34984
  closeMobileDestination();
34819
34985
  },
34820
34986
  onOpenResults: () => {
34821
- import_react_native24.Keyboard.dismiss();
34987
+ import_react_native25.Keyboard.dismiss();
34822
34988
  setSearchResultsOpen(true);
34823
34989
  closeMobileDestination();
34824
34990
  }
@@ -34903,7 +35069,7 @@ function ReadingShell({
34903
35069
  )
34904
35070
  ] }) });
34905
35071
  }
34906
- var styles23 = import_react_native24.StyleSheet.create({
35072
+ var styles23 = import_react_native25.StyleSheet.create({
34907
35073
  container: {
34908
35074
  flex: 1
34909
35075
  },