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

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,30 @@ 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
+ "worklet";
29784
+ return {
29785
+ opacity: 1 - progress.value,
29786
+ transform: [{ scale: 1 - progress.value * 0.04 }, { translateX: -progress.value * 6 }]
29787
+ };
29788
+ });
29789
+ const doneMotion = (0, import_react_native_reanimated2.useAnimatedStyle)(() => {
29790
+ "worklet";
29791
+ return {
29792
+ opacity: progress.value,
29793
+ transform: [{ scale: 0.96 + progress.value * 0.04 }, { translateX: (1 - progress.value) * 6 }]
29794
+ };
29795
+ });
29796
+ const [jumpModalOpen, setJumpModalOpen] = (0, import_react13.useState)(false);
29722
29797
  const isDark = uiTheme === "dark";
29723
29798
  const navIconColor = isDark ? "#e5e7eb" : "#111827";
29724
- const { width, height } = (0, import_react_native11.useWindowDimensions)();
29799
+ const { width, height } = (0, import_react_native12.useWindowDimensions)();
29725
29800
  const isLandscape = width > height;
29726
29801
  const insets = usePapyrusSafeAreaInsets();
29727
29802
  const navigateToPage = (targetPage) => {
@@ -29740,12 +29815,27 @@ var Topbar = ({
29740
29815
  }
29741
29816
  setJumpModalOpen(true);
29742
29817
  };
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" }) });
29818
+ 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
29819
  const logoElement = logo ?? defaultLogo;
29745
- if (!mobileChromeVisible) return null;
29820
+ const settingsControl = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29821
+ import_react_native12.Pressable,
29822
+ {
29823
+ onPress: () => onOpenOverflow?.() ?? onOpenSettings?.(),
29824
+ style: [
29825
+ styles10.iconButton,
29826
+ isDark && styles10.iconButtonDark,
29827
+ inkSession.supported && styles10.annotationSettingsButton
29828
+ ],
29829
+ accessibilityRole: "button",
29830
+ accessibilityLabel: "Open overflow menu",
29831
+ disabled: inkSession.active,
29832
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconSettings, { size: MOBILE_CHROME_METRICS.iconSize, color: isDark ? "#e5e7eb" : "#111827" })
29833
+ }
29834
+ );
29835
+ if (!mobileChromeVisible && !inkSession.active) return null;
29746
29836
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
29747
29837
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29748
- import_react_native11.View,
29838
+ import_react_native12.View,
29749
29839
  {
29750
29840
  style: [
29751
29841
  styles10.chromeFrame,
@@ -29758,7 +29848,7 @@ var Topbar = ({
29758
29848
  pointerEvents: "box-none",
29759
29849
  testID: "papyrus-floating-top-controls",
29760
29850
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
29761
- import_react_native11.View,
29851
+ import_react_native12.View,
29762
29852
  {
29763
29853
  style: [
29764
29854
  styles10.container,
@@ -29766,26 +29856,29 @@ var Topbar = ({
29766
29856
  isLandscape && styles10.containerLandscape
29767
29857
  ],
29768
29858
  children: [
29769
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native11.View, { style: styles10.leftGroup, children: [
29859
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.View, { style: styles10.leftGroup, children: [
29770
29860
  onLogoPress ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29771
- import_react_native11.Pressable,
29861
+ import_react_native12.Pressable,
29772
29862
  {
29773
- onPress: onLogoPress,
29863
+ onPress: () => {
29864
+ if (inkSession.active) inkSession.finish();
29865
+ else onLogoPress();
29866
+ },
29774
29867
  accessibilityRole: "button",
29775
29868
  accessibilityLabel: logoAccessibilityLabel,
29776
29869
  style: styles10.logoSlot,
29777
29870
  children: logoElement
29778
29871
  }
29779
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native11.View, { style: styles10.logoSlot, children: logoElement }),
29872
+ ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native12.View, { style: styles10.logoSlot, children: logoElement }),
29780
29873
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29781
- import_react_native11.Pressable,
29874
+ import_react_native12.Pressable,
29782
29875
  {
29783
29876
  onPress: openJumpModal,
29784
29877
  disabled: pageCount <= 0,
29785
29878
  style: styles10.titleHit,
29786
29879
  accessibilityLabel: "Open page jump",
29787
29880
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29788
- import_react_native11.Text,
29881
+ import_react_native12.Text,
29789
29882
  {
29790
29883
  numberOfLines: 1,
29791
29884
  style: [styles10.brandText, isDark && styles10.brandTextDark],
@@ -29795,9 +29888,9 @@ var Topbar = ({
29795
29888
  }
29796
29889
  )
29797
29890
  ] }),
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: [
29891
+ 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
29892
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29800
- import_react_native11.Pressable,
29893
+ import_react_native12.Pressable,
29801
29894
  {
29802
29895
  onPress: () => handlePageChange(-1),
29803
29896
  style: [styles10.pageButton, isDark && styles10.pageButtonDark],
@@ -29811,13 +29904,13 @@ var Topbar = ({
29811
29904
  }
29812
29905
  ),
29813
29906
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29814
- import_react_native11.Pressable,
29907
+ import_react_native12.Pressable,
29815
29908
  {
29816
29909
  onPress: openJumpModal,
29817
29910
  style: styles10.pageIndicatorHit,
29818
29911
  accessibilityLabel: "Page jump",
29819
29912
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
29820
- import_react_native11.Text,
29913
+ import_react_native12.Text,
29821
29914
  {
29822
29915
  style: [
29823
29916
  styles10.pageIndicator,
@@ -29833,7 +29926,7 @@ var Topbar = ({
29833
29926
  }
29834
29927
  ),
29835
29928
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29836
- import_react_native11.Pressable,
29929
+ import_react_native12.Pressable,
29837
29930
  {
29838
29931
  onPress: () => handlePageChange(1),
29839
29932
  style: [styles10.pageButton, isDark && styles10.pageButtonDark],
@@ -29847,21 +29940,49 @@ var Topbar = ({
29847
29940
  }
29848
29941
  )
29849
29942
  ] }) }) : 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,
29943
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29944
+ import_react_native12.View,
29852
29945
  {
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
- )
29946
+ style: [styles10.rightGroup, inkSession.supported && styles10.annotationActionSlot],
29947
+ testID: "papyrus-topbar-action-slot",
29948
+ children: inkSession.supported ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
29949
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29950
+ import_react_native_reanimated2.default.View,
29951
+ {
29952
+ style: [styles10.settingsSlot, settingsMotion],
29953
+ pointerEvents: inkSession.active ? "none" : "auto",
29954
+ accessibilityElementsHidden: inkSession.active,
29955
+ importantForAccessibility: inkSession.active ? "no-hide-descendants" : "auto",
29956
+ children: settingsControl
29957
+ }
29958
+ ),
29959
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29960
+ import_react_native_reanimated2.default.View,
29961
+ {
29962
+ style: [styles10.doneSlot, doneMotion],
29963
+ pointerEvents: inkSession.active ? "auto" : "none",
29964
+ accessibilityElementsHidden: !inkSession.active,
29965
+ importantForAccessibility: inkSession.active ? "auto" : "no-hide-descendants",
29966
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
29967
+ import_react_native12.Pressable,
29968
+ {
29969
+ onPress: inkSession.finish,
29970
+ disabled: !inkSession.active,
29971
+ style: styles10.doneButton,
29972
+ accessibilityRole: "button",
29973
+ accessibilityLabel: t.done,
29974
+ testID: "papyrus-topbar-ink-done",
29975
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native12.Text, { style: styles10.doneButtonText, children: [
29976
+ "\u2713 ",
29977
+ t.done
29978
+ ] })
29979
+ }
29980
+ )
29981
+ }
29982
+ )
29983
+ ] }) : settingsControl
29863
29984
  }
29864
- ) })
29985
+ )
29865
29986
  ]
29866
29987
  }
29867
29988
  )
@@ -29881,7 +30002,7 @@ var Topbar = ({
29881
30002
  )
29882
30003
  ] });
29883
30004
  };
29884
- var styles10 = import_react_native11.StyleSheet.create({
30005
+ var styles10 = import_react_native12.StyleSheet.create({
29885
30006
  container: {
29886
30007
  width: "100%",
29887
30008
  maxWidth: MOBILE_CHROME_METRICS.maxFloatingWidth,
@@ -30007,6 +30128,42 @@ var styles10 = import_react_native11.StyleSheet.create({
30007
30128
  flexShrink: 0,
30008
30129
  marginLeft: 12
30009
30130
  },
30131
+ annotationActionSlot: {
30132
+ width: 108,
30133
+ height: 44
30134
+ },
30135
+ settingsSlot: {
30136
+ position: "absolute",
30137
+ right: 0,
30138
+ top: 0
30139
+ },
30140
+ annotationSettingsButton: {
30141
+ minWidth: 44,
30142
+ minHeight: 44,
30143
+ marginLeft: 0,
30144
+ justifyContent: "center",
30145
+ alignItems: "center"
30146
+ },
30147
+ doneSlot: {
30148
+ position: "absolute",
30149
+ left: 0,
30150
+ right: 0,
30151
+ top: 0
30152
+ },
30153
+ doneButton: {
30154
+ minWidth: 44,
30155
+ minHeight: 44,
30156
+ paddingHorizontal: 10,
30157
+ borderRadius: 12,
30158
+ backgroundColor: "#2563eb",
30159
+ alignItems: "center",
30160
+ justifyContent: "center"
30161
+ },
30162
+ doneButtonText: {
30163
+ color: "#fff",
30164
+ fontSize: 14,
30165
+ fontWeight: "700"
30166
+ },
30010
30167
  iconButton: {
30011
30168
  paddingHorizontal: 10,
30012
30169
  paddingVertical: 6,
@@ -30042,9 +30199,9 @@ var styles10 = import_react_native11.StyleSheet.create({
30042
30199
  var Topbar_default = Topbar;
30043
30200
 
30044
30201
  // 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");
30202
+ var import_react14 = __toESM(require("react"));
30203
+ var import_react_native13 = require("react-native");
30204
+ var import_core10 = require("@papyrus-sdk/core");
30048
30205
 
30049
30206
  // components/ToolDock.layout.ts
30050
30207
  var TOOL_DOCK_SCROLL_THRESHOLD = 420;
@@ -30143,24 +30300,24 @@ var getToolVisual = (toolId) => {
30143
30300
  return { width: 24, iconSize: 28, offsetY: 6 };
30144
30301
  }
30145
30302
  };
30146
- var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30303
+ var OpacitySlider = import_react14.default.memo(function OpacitySlider2({
30147
30304
  value,
30148
30305
  color,
30149
30306
  isDark,
30150
30307
  onCommit
30151
30308
  }) {
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)(() => {
30309
+ const [trackWidth, setTrackWidth] = (0, import_react14.useState)(0);
30310
+ const [draftValue, setDraftValue] = (0, import_react14.useState)(value);
30311
+ const dragValueRef = (0, import_react14.useRef)(draftValue);
30312
+ const isDraggingRef = (0, import_react14.useRef)(false);
30313
+ const frameRef = (0, import_react14.useRef)(null);
30314
+ (0, import_react14.useEffect)(() => {
30158
30315
  if (!isDraggingRef.current) {
30159
30316
  dragValueRef.current = value;
30160
30317
  setDraftValue(value);
30161
30318
  }
30162
30319
  }, [value]);
30163
- (0, import_react13.useEffect)(() => {
30320
+ (0, import_react14.useEffect)(() => {
30164
30321
  return () => {
30165
30322
  if (frameRef.current !== null) {
30166
30323
  cancelAnimationFrame(frameRef.current);
@@ -30197,8 +30354,8 @@ var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30197
30354
  setDraftValue(next);
30198
30355
  onCommit(next);
30199
30356
  };
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,
30357
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.opacitySliderWrap, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
30358
+ import_react_native13.View,
30202
30359
  {
30203
30360
  style: styles11.opacityTouchSurface,
30204
30361
  onLayout: (event) => setTrackWidth(event.nativeEvent.layout.width),
@@ -30209,9 +30366,9 @@ var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30209
30366
  onResponderRelease: commitDraft,
30210
30367
  onResponderTerminate: () => commitDraft(),
30211
30368
  children: [
30212
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.opacityTrack }),
30369
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.opacityTrack }),
30213
30370
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30214
- import_react_native12.View,
30371
+ import_react_native13.View,
30215
30372
  {
30216
30373
  style: [
30217
30374
  styles11.opacityTrackFill,
@@ -30223,7 +30380,7 @@ var OpacitySlider = import_react13.default.memo(function OpacitySlider2({
30223
30380
  }
30224
30381
  ),
30225
30382
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30226
- import_react_native12.View,
30383
+ import_react_native13.View,
30227
30384
  {
30228
30385
  style: [
30229
30386
  styles11.opacityThumb,
@@ -30260,11 +30417,11 @@ var ToolDock = () => {
30260
30417
  annotationRedoStack,
30261
30418
  undoAnnotations,
30262
30419
  redoAnnotations
30263
- } = (0, import_core9.useViewerStore)();
30264
- const [paletteExpanded, setPaletteExpanded] = (0, import_react13.useState)(false);
30265
- const [extrasExpanded, setExtrasExpanded] = (0, import_react13.useState)(false);
30420
+ } = (0, import_core10.useViewerStore)();
30421
+ const [paletteExpanded, setPaletteExpanded] = (0, import_react14.useState)(false);
30422
+ const [extrasExpanded, setExtrasExpanded] = (0, import_react14.useState)(false);
30266
30423
  const isDark = uiTheme === "dark";
30267
- const { width: windowWidth } = (0, import_react_native12.useWindowDimensions)();
30424
+ const { width: windowWidth } = (0, import_react_native13.useWindowDimensions)();
30268
30425
  const t = getStrings(locale);
30269
30426
  const panelColor = isDark ? "rgba(24,24,27,0.92)" : "rgba(255,255,255,0.96)";
30270
30427
  const borderColor = isDark ? "rgba(71,85,105,0.48)" : "rgba(229,231,235,0.88)";
@@ -30272,7 +30429,7 @@ var ToolDock = () => {
30272
30429
  const iconColor = isDark ? "#e5e7eb" : "#111827";
30273
30430
  const labelColor = isDark ? "#e5e7eb" : "#374151";
30274
30431
  const utilityIconColor = isDark ? "#f8fafc" : "#111827";
30275
- const selectedTool = (0, import_react13.useMemo)(
30432
+ const selectedTool = (0, import_react14.useMemo)(
30276
30433
  () => ALL_TOOLS.find(
30277
30434
  (tool) => tool.id === "ink" || tool.id === "highlight" || tool.id === "underline" ? activeTool === "ink" && activeDrawToolPreset === tool.id : isToolDockToolSelected({
30278
30435
  toolId: tool.id,
@@ -30289,7 +30446,7 @@ var ToolDock = () => {
30289
30446
  const canUndo = annotationUndoStack.length > 0;
30290
30447
  const canRedo = annotationRedoStack.length > 0;
30291
30448
  const primaryToolsRowIsScrollable = shouldUseScrollablePrimaryToolsRow(windowWidth);
30292
- (0, import_react13.useEffect)(() => {
30449
+ (0, import_react14.useEffect)(() => {
30293
30450
  if (!nativeInkToolPickerActive) return;
30294
30451
  setPaletteExpanded(false);
30295
30452
  setExtrasExpanded(false);
@@ -30356,7 +30513,7 @@ var ToolDock = () => {
30356
30513
  baseIconColor
30357
30514
  });
30358
30515
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30359
- import_react_native12.Pressable,
30516
+ import_react_native13.Pressable,
30360
30517
  {
30361
30518
  onPress: () => {
30362
30519
  applyTool(tool.id);
@@ -30367,7 +30524,7 @@ var ToolDock = () => {
30367
30524
  { width: compact ? void 0 : visual.width }
30368
30525
  ],
30369
30526
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30370
- import_react_native12.View,
30527
+ import_react_native13.View,
30371
30528
  {
30372
30529
  style: [
30373
30530
  compact ? styles11.compactToolIconWrap : styles11.toolIconWrap,
@@ -30393,13 +30550,13 @@ var ToolDock = () => {
30393
30550
  );
30394
30551
  };
30395
30552
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30396
- import_react_native12.View,
30553
+ import_react_native13.View,
30397
30554
  {
30398
30555
  pointerEvents: "box-none",
30399
30556
  style: [styles11.root, { paddingBottom: chromeOffsets.toolDock }],
30400
- children: toolDockOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native12.View, { style: styles11.stack, children: [
30557
+ children: toolDockOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.stack, children: [
30401
30558
  paletteExpanded && showInkDockControls ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30402
- import_react_native12.View,
30559
+ import_react_native13.View,
30403
30560
  {
30404
30561
  style: [
30405
30562
  styles11.popup,
@@ -30408,10 +30565,10 @@ var ToolDock = () => {
30408
30565
  borderColor
30409
30566
  }
30410
30567
  ],
30411
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.swatchRow, children: COLOR_SWATCHES.map((color) => {
30568
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.swatchRow, children: COLOR_SWATCHES.map((color) => {
30412
30569
  const isSelected = annotationColor === color;
30413
30570
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30414
- import_react_native12.Pressable,
30571
+ import_react_native13.Pressable,
30415
30572
  {
30416
30573
  onPress: () => setAnnotationColor(color),
30417
30574
  style: [
@@ -30422,7 +30579,7 @@ var ToolDock = () => {
30422
30579
  }
30423
30580
  ],
30424
30581
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30425
- import_react_native12.View,
30582
+ import_react_native13.View,
30426
30583
  {
30427
30584
  style: [
30428
30585
  styles11.swatch,
@@ -30440,7 +30597,7 @@ var ToolDock = () => {
30440
30597
  }
30441
30598
  ) : null,
30442
30599
  inkSettingsExpanded && showInkDockControls ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
30443
- import_react_native12.View,
30600
+ import_react_native13.View,
30444
30601
  {
30445
30602
  style: [
30446
30603
  styles11.popup,
@@ -30451,10 +30608,10 @@ var ToolDock = () => {
30451
30608
  }
30452
30609
  ],
30453
30610
  children: [
30454
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.inkPreviewRow, children: INK_WIDTHS.map((width) => {
30611
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.inkPreviewRow, children: INK_WIDTHS.map((width) => {
30455
30612
  const selected = Math.abs(inkStrokeWidth - width) < 5e-4;
30456
30613
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30457
- import_react_native12.Pressable,
30614
+ import_react_native13.Pressable,
30458
30615
  {
30459
30616
  onPress: () => setInkStrokeWidth(width),
30460
30617
  style: [
@@ -30464,7 +30621,7 @@ var ToolDock = () => {
30464
30621
  borderColor: `${accentColor}30`
30465
30622
  }
30466
30623
  ],
30467
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.inkNib, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30624
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.inkNib, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30468
30625
  IconToolInk,
30469
30626
  {
30470
30627
  size: Math.round(18 + width * 1200),
@@ -30488,7 +30645,7 @@ var ToolDock = () => {
30488
30645
  }
30489
30646
  ) : null,
30490
30647
  extrasExpanded ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30491
- import_react_native12.View,
30648
+ import_react_native13.View,
30492
30649
  {
30493
30650
  style: [
30494
30651
  styles11.popup,
@@ -30498,11 +30655,11 @@ var ToolDock = () => {
30498
30655
  borderColor
30499
30656
  }
30500
30657
  ],
30501
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native12.View, { style: styles11.compactToolsRow, children: EXTRA_TOOLS.map((tool) => renderToolButton(tool, true)) })
30658
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.compactToolsRow, children: EXTRA_TOOLS.map((tool) => renderToolButton(tool, true)) })
30502
30659
  }
30503
30660
  ) : null,
30504
30661
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30505
- import_react_native12.View,
30662
+ import_react_native13.View,
30506
30663
  {
30507
30664
  style: [
30508
30665
  styles11.container,
@@ -30512,7 +30669,7 @@ var ToolDock = () => {
30512
30669
  }
30513
30670
  ],
30514
30671
  children: primaryToolsRowIsScrollable ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30515
- import_react_native12.ScrollView,
30672
+ import_react_native13.ScrollView,
30516
30673
  {
30517
30674
  horizontal: true,
30518
30675
  bounces: false,
@@ -30522,10 +30679,10 @@ var ToolDock = () => {
30522
30679
  styles11.primaryToolsRow,
30523
30680
  styles11.primaryToolsRowScrollableContent
30524
30681
  ],
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: [
30682
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.primaryToolsRowInner, children: [
30683
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.historyGroup, children: [
30527
30684
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30528
- import_react_native12.Pressable,
30685
+ import_react_native13.Pressable,
30529
30686
  {
30530
30687
  onPress: undoAnnotations,
30531
30688
  disabled: !canUndo,
@@ -30546,7 +30703,7 @@ var ToolDock = () => {
30546
30703
  }
30547
30704
  ),
30548
30705
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30549
- import_react_native12.Pressable,
30706
+ import_react_native13.Pressable,
30550
30707
  {
30551
30708
  onPress: redoAnnotations,
30552
30709
  disabled: !canRedo,
@@ -30567,10 +30724,10 @@ var ToolDock = () => {
30567
30724
  }
30568
30725
  )
30569
30726
  ] }),
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: [
30727
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
30728
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.controlsGroup, children: [
30572
30729
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30573
- import_react_native12.Pressable,
30730
+ import_react_native13.Pressable,
30574
30731
  {
30575
30732
  onPress: () => {
30576
30733
  setExtrasExpanded((value) => !value);
@@ -30583,7 +30740,7 @@ var ToolDock = () => {
30583
30740
  }
30584
30741
  ],
30585
30742
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30586
- import_react_native12.Text,
30743
+ import_react_native13.Text,
30587
30744
  {
30588
30745
  style: [
30589
30746
  styles11.utilityLabel,
@@ -30595,7 +30752,7 @@ var ToolDock = () => {
30595
30752
  }
30596
30753
  ),
30597
30754
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30598
- import_react_native12.Pressable,
30755
+ import_react_native13.Pressable,
30599
30756
  {
30600
30757
  onPress: () => {
30601
30758
  setPaletteExpanded((value) => !value);
@@ -30613,7 +30770,7 @@ var ToolDock = () => {
30613
30770
  }
30614
30771
  ),
30615
30772
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30616
- import_react_native12.Pressable,
30773
+ import_react_native13.Pressable,
30617
30774
  {
30618
30775
  onPress: () => setDocumentState(
30619
30776
  getToolDockDismissState({
@@ -30638,10 +30795,10 @@ var ToolDock = () => {
30638
30795
  ] })
30639
30796
  ] })
30640
30797
  }
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: [
30798
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.primaryToolsRow, children: [
30799
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.historyGroup, children: [
30643
30800
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30644
- import_react_native12.Pressable,
30801
+ import_react_native13.Pressable,
30645
30802
  {
30646
30803
  onPress: undoAnnotations,
30647
30804
  disabled: !canUndo,
@@ -30662,7 +30819,7 @@ var ToolDock = () => {
30662
30819
  }
30663
30820
  ),
30664
30821
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30665
- import_react_native12.Pressable,
30822
+ import_react_native13.Pressable,
30666
30823
  {
30667
30824
  onPress: redoAnnotations,
30668
30825
  disabled: !canRedo,
@@ -30683,10 +30840,10 @@ var ToolDock = () => {
30683
30840
  }
30684
30841
  )
30685
30842
  ] }),
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: [
30843
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native13.View, { style: styles11.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
30844
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native13.View, { style: styles11.controlsGroup, children: [
30688
30845
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30689
- import_react_native12.Pressable,
30846
+ import_react_native13.Pressable,
30690
30847
  {
30691
30848
  onPress: () => {
30692
30849
  setExtrasExpanded((value) => !value);
@@ -30699,7 +30856,7 @@ var ToolDock = () => {
30699
30856
  }
30700
30857
  ],
30701
30858
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30702
- import_react_native12.Text,
30859
+ import_react_native13.Text,
30703
30860
  {
30704
30861
  style: [
30705
30862
  styles11.utilityLabel,
@@ -30711,7 +30868,7 @@ var ToolDock = () => {
30711
30868
  }
30712
30869
  ),
30713
30870
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30714
- import_react_native12.Pressable,
30871
+ import_react_native13.Pressable,
30715
30872
  {
30716
30873
  onPress: () => {
30717
30874
  setPaletteExpanded((value) => !value);
@@ -30729,7 +30886,7 @@ var ToolDock = () => {
30729
30886
  }
30730
30887
  ),
30731
30888
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
30732
- import_react_native12.Pressable,
30889
+ import_react_native13.Pressable,
30733
30890
  {
30734
30891
  onPress: () => setDocumentState(
30735
30892
  getToolDockDismissState({
@@ -30756,9 +30913,9 @@ var ToolDock = () => {
30756
30913
  }
30757
30914
  );
30758
30915
  };
30759
- var styles11 = import_react_native12.StyleSheet.create({
30916
+ var styles11 = import_react_native13.StyleSheet.create({
30760
30917
  root: {
30761
- ...import_react_native12.StyleSheet.absoluteFillObject,
30918
+ ...import_react_native13.StyleSheet.absoluteFillObject,
30762
30919
  alignItems: "center",
30763
30920
  justifyContent: "flex-end",
30764
30921
  paddingHorizontal: MOBILE_CHROME_METRICS.screenPadding,
@@ -31001,9 +31158,9 @@ var withInkAlpha = (hex, alpha) => {
31001
31158
  var ToolDock_default = ToolDock;
31002
31159
 
31003
31160
  // 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");
31161
+ var import_react15 = require("react");
31162
+ var import_react_native14 = require("react-native");
31163
+ var import_core11 = require("@papyrus-sdk/core");
31007
31164
  var import_engine_native7 = require("@papyrus-sdk/engine-native");
31008
31165
 
31009
31166
  // components/rightSheetLayout.ts
@@ -31068,14 +31225,14 @@ var PageThumbnail = ({
31068
31225
  shouldRenderPreview,
31069
31226
  onPress
31070
31227
  }) => {
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)(() => {
31228
+ const viewRef = (0, import_react15.useRef)(null);
31229
+ const [layoutReady, setLayoutReady] = (0, import_react15.useState)(false);
31230
+ const [previewUri, setPreviewUri] = (0, import_react15.useState)(null);
31231
+ (0, import_react15.useEffect)(() => {
31075
31232
  if (!layoutReady || !useNativePreview || !shouldRenderPreview) return;
31076
- const viewTag = (0, import_react_native13.findNodeHandle)(viewRef.current);
31233
+ const viewTag = (0, import_react_native14.findNodeHandle)(viewRef.current);
31077
31234
  if (!viewTag) return;
31078
- const isNative = import_react_native13.Platform.OS === "android" || import_react_native13.Platform.OS === "ios";
31235
+ const isNative = import_react_native14.Platform.OS === "android" || import_react_native14.Platform.OS === "ios";
31079
31236
  const renderScale = isNative ? 2 / Math.max(zoom, 0.5) : 2;
31080
31237
  void engine.renderPage(pageIndex, viewTag, renderScale);
31081
31238
  }, [
@@ -31086,7 +31243,7 @@ var PageThumbnail = ({
31086
31243
  useNativePreview,
31087
31244
  zoom
31088
31245
  ]);
31089
- (0, import_react14.useEffect)(() => {
31246
+ (0, import_react15.useEffect)(() => {
31090
31247
  if (!useImagePreview || !shouldRenderPreview) {
31091
31248
  setPreviewUri(null);
31092
31249
  return;
@@ -31110,7 +31267,7 @@ var PageThumbnail = ({
31110
31267
  }
31111
31268
  };
31112
31269
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31113
- import_react_native13.Pressable,
31270
+ import_react_native14.Pressable,
31114
31271
  {
31115
31272
  onPress,
31116
31273
  style: [
@@ -31122,23 +31279,23 @@ var PageThumbnail = ({
31122
31279
  ],
31123
31280
  children: [
31124
31281
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31125
- import_react_native13.View,
31282
+ import_react_native14.View,
31126
31283
  {
31127
31284
  onLayout: handleLayout,
31128
31285
  style: [styles12.thumbFrame, { width: frameWidth, height: frameHeight }],
31129
31286
  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,
31287
+ import_react_native14.Image,
31131
31288
  {
31132
31289
  source: { uri: previewUri },
31133
31290
  resizeMode: "contain",
31134
31291
  style: styles12.thumbImage
31135
31292
  }
31136
31293
  ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31137
- import_react_native13.View,
31294
+ import_react_native14.View,
31138
31295
  {
31139
31296
  style: [styles12.thumbFallback, isDark && styles12.thumbFallbackDark],
31140
31297
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31141
- import_react_native13.Text,
31298
+ import_react_native14.Text,
31142
31299
  {
31143
31300
  style: [
31144
31301
  styles12.thumbFallbackText,
@@ -31151,7 +31308,7 @@ var PageThumbnail = ({
31151
31308
  )
31152
31309
  }
31153
31310
  ),
31154
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.Text, { style: [styles12.thumbLabel, isDark && styles12.thumbLabelDark], children: pageIndex + 1 })
31311
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.thumbLabel, isDark && styles12.thumbLabelDark], children: pageIndex + 1 })
31155
31312
  ]
31156
31313
  }
31157
31314
  );
@@ -31159,16 +31316,16 @@ var PageThumbnail = ({
31159
31316
  var OutlineNode = ({ item, depth = 0, isDark, onSelect, untitledLabel }) => {
31160
31317
  const hasChildren = item.children && item.children.length > 0;
31161
31318
  const isClickable = item.pageIndex >= 0;
31162
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { children: [
31319
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { children: [
31163
31320
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31164
- import_react_native13.Pressable,
31321
+ import_react_native14.Pressable,
31165
31322
  {
31166
31323
  onPress: () => {
31167
31324
  if (isClickable) onSelect(item.pageIndex);
31168
31325
  },
31169
31326
  style: [styles12.outlineRow, { paddingLeft: 12 + depth * 12 }],
31170
31327
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31171
- import_react_native13.Text,
31328
+ import_react_native14.Text,
31172
31329
  {
31173
31330
  style: [
31174
31331
  styles12.outlineText,
@@ -31215,12 +31372,12 @@ var RightSheet = ({
31215
31372
  zoom,
31216
31373
  locale,
31217
31374
  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)(
31375
+ } = (0, import_core11.useViewerStore)();
31376
+ const { height: windowHeight, width: windowWidth } = (0, import_react_native14.useWindowDimensions)();
31377
+ const [pagesMode, setPagesMode] = (0, import_react15.useState)(
31221
31378
  documentType === "pdf" || documentType === "comic" ? "thumbnails" : "summary"
31222
31379
  );
31223
- (0, import_react14.useEffect)(() => {
31380
+ (0, import_react15.useEffect)(() => {
31224
31381
  setPagesMode(
31225
31382
  documentType === "pdf" || documentType === "comic" ? "thumbnails" : "summary"
31226
31383
  );
@@ -31237,16 +31394,16 @@ var RightSheet = ({
31237
31394
  const { cardWidth, frameWidth } = getRightSheetThumbnailLayout(sheetWidth);
31238
31395
  const renderTarget = engine.getRenderTargetType?.();
31239
31396
  const hasNativePageView = Boolean(
31240
- import_react_native13.UIManager.getViewManagerConfig?.("PapyrusPageView")
31397
+ import_react_native14.UIManager.getViewManagerConfig?.("PapyrusPageView")
31241
31398
  );
31242
31399
  const useNativePreview = renderTarget !== "webview" && hasNativePageView;
31243
31400
  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)(
31401
+ const thumbnailDimensionsCacheRef = (0, import_react15.useRef)(/* @__PURE__ */ new Map());
31402
+ const thumbnailDimensionsPendingRef = (0, import_react15.useRef)(/* @__PURE__ */ new Set());
31403
+ const thumbnailRefreshTimeoutRef = (0, import_react15.useRef)(null);
31404
+ const [thumbnailLayoutRevision, setThumbnailLayoutRevision] = (0, import_react15.useState)(0);
31405
+ const [visibleThumbnailPages, setVisibleThumbnailPages] = (0, import_react15.useState)(() => /* @__PURE__ */ new Set());
31406
+ const resolvedThumbsInitialCount = (0, import_react15.useMemo)(
31250
31407
  () => resolvePositiveInt2(
31251
31408
  thumbsInitialCount,
31252
31409
  THUMBNAILS_INITIAL_NUM_TO_RENDER,
@@ -31265,10 +31422,10 @@ var RightSheet = ({
31265
31422
  const navigationTitle = showingProgress ? t.progress : documentType === "epub" || activeMobileDestination === "contents" ? t.contents : t.pages;
31266
31423
  const summaryLabel = documentType === "epub" ? t.contents : t.summaryTab;
31267
31424
  const thumbnailLabel = documentType === "epub" ? t.pages : t.pagesTab;
31268
- const closeSheet = (0, import_react14.useCallback)(() => {
31425
+ const closeSheet = (0, import_react15.useCallback)(() => {
31269
31426
  setDocumentState({ sidebarRightOpen: false });
31270
31427
  }, [setDocumentState]);
31271
- const jumpToPage = (0, import_react14.useCallback)(
31428
+ const jumpToPage = (0, import_react15.useCallback)(
31272
31429
  (pageIndex) => {
31273
31430
  engine.goToPage(pageIndex + 1);
31274
31431
  setDocumentState({ currentPage: pageIndex + 1 });
@@ -31277,14 +31434,14 @@ var RightSheet = ({
31277
31434
  },
31278
31435
  [closeSheet, engine, setDocumentState, triggerScrollToPage]
31279
31436
  );
31280
- const scheduleThumbnailLayoutRefresh = (0, import_react14.useCallback)(() => {
31437
+ const scheduleThumbnailLayoutRefresh = (0, import_react15.useCallback)(() => {
31281
31438
  if (thumbnailRefreshTimeoutRef.current) return;
31282
31439
  thumbnailRefreshTimeoutRef.current = setTimeout(() => {
31283
31440
  thumbnailRefreshTimeoutRef.current = null;
31284
31441
  setThumbnailLayoutRevision((value) => value + 1);
31285
31442
  }, 80);
31286
31443
  }, []);
31287
- const ensureThumbnailDimensions = (0, import_react14.useCallback)(
31444
+ const ensureThumbnailDimensions = (0, import_react15.useCallback)(
31288
31445
  (pageIndex) => {
31289
31446
  if (pageIndex < 0 || pageIndex >= pageCount) return;
31290
31447
  if (thumbnailDimensionsCacheRef.current.has(pageIndex)) return;
@@ -31303,7 +31460,7 @@ var RightSheet = ({
31303
31460
  },
31304
31461
  [engine, pageCount, scheduleThumbnailLayoutRefresh]
31305
31462
  );
31306
- const getThumbnailFrameHeight = (0, import_react14.useCallback)(
31463
+ const getThumbnailFrameHeight = (0, import_react15.useCallback)(
31307
31464
  (pageIndex) => {
31308
31465
  const dims = thumbnailDimensionsCacheRef.current.get(pageIndex);
31309
31466
  const ratio = !dims || dims.width <= 0 || dims.height <= 0 ? THUMBNAILS_DEFAULT_ASPECT_RATIO : dims.height / dims.width;
@@ -31315,7 +31472,7 @@ var RightSheet = ({
31315
31472
  },
31316
31473
  [frameWidth, thumbnailLayoutRevision]
31317
31474
  );
31318
- (0, import_react14.useEffect)(
31475
+ (0, import_react15.useEffect)(
31319
31476
  () => () => {
31320
31477
  if (thumbnailRefreshTimeoutRef.current) {
31321
31478
  clearTimeout(thumbnailRefreshTimeoutRef.current);
@@ -31323,11 +31480,11 @@ var RightSheet = ({
31323
31480
  },
31324
31481
  []
31325
31482
  );
31326
- (0, import_react14.useEffect)(() => {
31483
+ (0, import_react15.useEffect)(() => {
31327
31484
  if (sidebarRightOpen) return;
31328
31485
  setVisibleThumbnailPages(/* @__PURE__ */ new Set());
31329
31486
  }, [sidebarRightOpen]);
31330
- (0, import_react14.useEffect)(() => {
31487
+ (0, import_react15.useEffect)(() => {
31331
31488
  if (!sidebarRightOpen || sidebarRightTab !== "pages") return;
31332
31489
  if (activeMobileDestination === "pages") {
31333
31490
  setPagesMode("thumbnails");
@@ -31335,7 +31492,7 @@ var RightSheet = ({
31335
31492
  }
31336
31493
  setPagesMode("summary");
31337
31494
  }, [activeMobileDestination, sidebarRightOpen, sidebarRightTab]);
31338
- (0, import_react14.useEffect)(() => {
31495
+ (0, import_react15.useEffect)(() => {
31339
31496
  if (!sidebarRightOpen || sidebarRightTab !== "pages") return;
31340
31497
  if (pagesMode !== "thumbnails" || !supportsThumbnails) return;
31341
31498
  if (pageCount <= 0) return;
@@ -31365,18 +31522,18 @@ var RightSheet = ({
31365
31522
  sidebarRightTab,
31366
31523
  supportsThumbnails
31367
31524
  ]);
31368
- const pages = (0, import_react14.useMemo)(
31525
+ const pages = (0, import_react15.useMemo)(
31369
31526
  () => Array.from({ length: pageCount }, (_, i) => i),
31370
31527
  [pageCount]
31371
31528
  );
31372
- const progressEntries = (0, import_react14.useMemo)(
31529
+ const progressEntries = (0, import_react15.useMemo)(
31373
31530
  () => pages.map((pageIndex) => ({
31374
31531
  pageIndex,
31375
31532
  percent: pageCount <= 1 ? 100 : Math.round((pageIndex + 1) / pageCount * 100)
31376
31533
  })),
31377
31534
  [pageCount, pages]
31378
31535
  );
31379
- const onThumbnailsViewableItemsChanged = (0, import_react14.useCallback)(
31536
+ const onThumbnailsViewableItemsChanged = (0, import_react15.useCallback)(
31380
31537
  ({ viewableItems }) => {
31381
31538
  const nextVisible = /* @__PURE__ */ new Set();
31382
31539
  viewableItems.forEach((token) => {
@@ -31393,7 +31550,7 @@ var RightSheet = ({
31393
31550
  },
31394
31551
  [ensureThumbnailDimensions]
31395
31552
  );
31396
- const renderThumbnailItem = (0, import_react14.useCallback)(
31553
+ const renderThumbnailItem = (0, import_react15.useCallback)(
31397
31554
  ({ item }) => {
31398
31555
  const shouldRenderPreview = (useNativePreview || useImagePreview) && (visibleThumbnailPages.has(item) || item < resolvedThumbsPrewarmCount || Math.abs(item + 1 - currentPage) <= 1);
31399
31556
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -31444,18 +31601,18 @@ var RightSheet = ({
31444
31601
  backgroundColor: palette.surface,
31445
31602
  borderTopColor: palette.divider
31446
31603
  },
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 }),
31604
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.sheet, children: [
31605
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.header, children: [
31606
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.sheetTitle, isDark && styles12.sheetTitleDark], children: showingNotes ? t.notes : navigationTitle }),
31450
31607
  !showingNotes ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31451
- import_react_native13.Pressable,
31608
+ import_react_native14.Pressable,
31452
31609
  {
31453
31610
  onPress: showingProgress ? void 0 : onOpenPageJump,
31454
31611
  disabled: showingProgress || pageCount <= 0,
31455
31612
  style: styles12.pageStatusHit,
31456
31613
  accessibilityLabel: "Open page jump",
31457
31614
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31458
- import_react_native13.Text,
31615
+ import_react_native14.Text,
31459
31616
  {
31460
31617
  style: [styles12.pageStatus, isDark && styles12.pageStatusDark],
31461
31618
  children: showingProgress ? `${Math.round(
@@ -31466,7 +31623,7 @@ var RightSheet = ({
31466
31623
  }
31467
31624
  ) : null,
31468
31625
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31469
- import_react_native13.Pressable,
31626
+ import_react_native14.Pressable,
31470
31627
  {
31471
31628
  accessibilityRole: "button",
31472
31629
  accessibilityLabel: `${t.close} ${showingNotes ? t.notes.toLowerCase() : t.contents.toLowerCase()}`,
@@ -31476,14 +31633,14 @@ var RightSheet = ({
31476
31633
  }
31477
31634
  )
31478
31635
  ] }),
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,
31636
+ !showingNotes ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.pagesContent, children: [
31637
+ !showingProgress ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.View, { style: styles12.pageHeader, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31638
+ import_react_native14.View,
31482
31639
  {
31483
31640
  style: [styles12.segmented, isDark && styles12.segmentedDark],
31484
31641
  children: [
31485
31642
  supportsThumbnails ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31486
- import_react_native13.Pressable,
31643
+ import_react_native14.Pressable,
31487
31644
  {
31488
31645
  onPress: () => setPagesMode("thumbnails"),
31489
31646
  style: [
@@ -31494,7 +31651,7 @@ var RightSheet = ({
31494
31651
  }
31495
31652
  ],
31496
31653
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31497
- import_react_native13.Text,
31654
+ import_react_native14.Text,
31498
31655
  {
31499
31656
  style: [
31500
31657
  styles12.segmentText,
@@ -31507,7 +31664,7 @@ var RightSheet = ({
31507
31664
  }
31508
31665
  ) : null,
31509
31666
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31510
- import_react_native13.Pressable,
31667
+ import_react_native14.Pressable,
31511
31668
  {
31512
31669
  onPress: () => setPagesMode("summary"),
31513
31670
  style: [
@@ -31518,7 +31675,7 @@ var RightSheet = ({
31518
31675
  }
31519
31676
  ],
31520
31677
  children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31521
- import_react_native13.Text,
31678
+ import_react_native14.Text,
31522
31679
  {
31523
31680
  style: [
31524
31681
  styles12.segmentText,
@@ -31561,7 +31718,7 @@ var RightSheet = ({
31561
31718
  children: progressEntries.map((entry) => {
31562
31719
  const isActive = entry.pageIndex + 1 === currentPage;
31563
31720
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31564
- import_react_native13.Pressable,
31721
+ import_react_native14.Pressable,
31565
31722
  {
31566
31723
  onPress: () => jumpToPage(entry.pageIndex),
31567
31724
  style: [
@@ -31571,7 +31728,7 @@ var RightSheet = ({
31571
31728
  ],
31572
31729
  children: [
31573
31730
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31574
- import_react_native13.Text,
31731
+ import_react_native14.Text,
31575
31732
  {
31576
31733
  style: [
31577
31734
  styles12.progressLabel,
@@ -31584,7 +31741,7 @@ var RightSheet = ({
31584
31741
  }
31585
31742
  ),
31586
31743
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31587
- import_react_native13.Text,
31744
+ import_react_native14.Text,
31588
31745
  {
31589
31746
  style: [
31590
31747
  styles12.progressMeta,
@@ -31609,7 +31766,7 @@ var RightSheet = ({
31609
31766
  contentContainerStyle: styles12.summaryContent,
31610
31767
  showsVerticalScrollIndicator: false,
31611
31768
  children: outline.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31612
- import_react_native13.Text,
31769
+ import_react_native14.Text,
31613
31770
  {
31614
31771
  style: [styles12.emptyText, isDark && styles12.emptyTextDark],
31615
31772
  children: t.noSummary
@@ -31631,8 +31788,8 @@ var RightSheet = ({
31631
31788
  {
31632
31789
  contentContainerStyle: styles12.notesContent,
31633
31790
  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,
31791
+ 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)(
31792
+ import_react_native14.Pressable,
31636
31793
  {
31637
31794
  onPress: () => {
31638
31795
  setSelectedAnnotation(ann.id);
@@ -31647,27 +31804,27 @@ var RightSheet = ({
31647
31804
  }
31648
31805
  ],
31649
31806
  children: [
31650
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.noteHeader, children: [
31807
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.noteHeader, children: [
31651
31808
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31652
- import_react_native13.View,
31809
+ import_react_native14.View,
31653
31810
  {
31654
31811
  style: [styles12.noteDot, { backgroundColor: ann.color }]
31655
31812
  }
31656
31813
  ),
31657
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.Text, { style: [styles12.noteTitle, { color: palette.text }], children: [
31814
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.Text, { style: [styles12.noteTitle, { color: palette.text }], children: [
31658
31815
  t.page,
31659
31816
  " ",
31660
31817
  ann.pageIndex + 1
31661
31818
  ] })
31662
31819
  ] }),
31663
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native13.Text, { style: [styles12.noteType, { color: accentColor }], children: getAnnotationKindLabel(ann.type, locale) }),
31820
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native14.Text, { style: [styles12.noteType, { color: accentColor }], children: getAnnotationKindLabel(ann.type, locale) }),
31664
31821
  ann.content ? (() => {
31665
31822
  const parts = resolveNoteQuoteParts(
31666
31823
  ann.content ?? ""
31667
31824
  );
31668
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native13.View, { style: styles12.noteQuoteRow, children: [
31825
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native14.View, { style: styles12.noteQuoteRow, children: [
31669
31826
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31670
- import_react_native13.View,
31827
+ import_react_native14.View,
31671
31828
  {
31672
31829
  accessible: false,
31673
31830
  importantForAccessibility: "no",
@@ -31676,7 +31833,7 @@ var RightSheet = ({
31676
31833
  }
31677
31834
  ),
31678
31835
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
31679
- import_react_native13.Text,
31836
+ import_react_native14.Text,
31680
31837
  {
31681
31838
  style: [
31682
31839
  styles12.noteContent,
@@ -31693,7 +31850,7 @@ var RightSheet = ({
31693
31850
  }
31694
31851
  ),
31695
31852
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
31696
- import_react_native13.View,
31853
+ import_react_native14.View,
31697
31854
  {
31698
31855
  accessible: false,
31699
31856
  importantForAccessibility: "no",
@@ -31713,7 +31870,7 @@ var RightSheet = ({
31713
31870
  }
31714
31871
  );
31715
31872
  };
31716
- var styles12 = import_react_native13.StyleSheet.create({
31873
+ var styles12 = import_react_native14.StyleSheet.create({
31717
31874
  sheet: {
31718
31875
  flex: 1,
31719
31876
  maxHeight: "100%",
@@ -31999,9 +32156,9 @@ var styles12 = import_react_native13.StyleSheet.create({
31999
32156
  var RightSheet_default = RightSheet;
32000
32157
 
32001
32158
  // 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");
32159
+ var import_react16 = require("react");
32160
+ var import_react_native15 = require("react-native");
32161
+ var import_core12 = require("@papyrus-sdk/core");
32005
32162
  var import_jsx_runtime17 = require("react/jsx-runtime");
32006
32163
  var AnnotationEditor = () => {
32007
32164
  const {
@@ -32013,13 +32170,13 @@ var AnnotationEditor = () => {
32013
32170
  uiTheme,
32014
32171
  locale,
32015
32172
  accentColor
32016
- } = (0, import_core11.useViewerStore)();
32173
+ } = (0, import_core12.useViewerStore)();
32017
32174
  const annotation = annotations.find((ann) => ann.id === selectedAnnotationId);
32018
32175
  const isEditable = annotation && (annotation.type === "text" || annotation.type === "comment");
32019
- const [draft, setDraft] = (0, import_react15.useState)("");
32176
+ const [draft, setDraft] = (0, import_react16.useState)("");
32020
32177
  const isDark = uiTheme === "dark";
32021
32178
  const t = getStrings(locale);
32022
- (0, import_react15.useEffect)(() => {
32179
+ (0, import_react16.useEffect)(() => {
32023
32180
  if (isEditable) {
32024
32181
  setDraft(annotation?.content ?? "");
32025
32182
  }
@@ -32038,16 +32195,16 @@ var AnnotationEditor = () => {
32038
32195
  );
32039
32196
  };
32040
32197
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32041
- import_react_native14.Modal,
32198
+ import_react_native15.Modal,
32042
32199
  {
32043
32200
  visible: true,
32044
32201
  transparent: true,
32045
32202
  animationType: "fade",
32046
32203
  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 }),
32204
+ 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: [
32205
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: [styles13.title, isDark && styles13.titleDark], children: t.editNote }),
32049
32206
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32050
- import_react_native14.TextInput,
32207
+ import_react_native15.TextInput,
32051
32208
  {
32052
32209
  style: [styles13.input, isDark && styles13.inputDark],
32053
32210
  value: draft,
@@ -32057,9 +32214,9 @@ var AnnotationEditor = () => {
32057
32214
  multiline: true
32058
32215
  }
32059
32216
  ),
32060
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native14.View, { style: styles13.actions, children: [
32217
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native15.View, { style: styles13.actions, children: [
32061
32218
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32062
- import_react_native14.Pressable,
32219
+ import_react_native15.Pressable,
32063
32220
  {
32064
32221
  onPress: handleDelete,
32065
32222
  style: [
@@ -32070,20 +32227,20 @@ var AnnotationEditor = () => {
32070
32227
  accessibilityRole: "button",
32071
32228
  accessibilityLabel: t.deleteAnnotation,
32072
32229
  testID: "annotation-delete-button",
32073
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.deleteAnnotation })
32230
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.deleteAnnotation })
32074
32231
  }
32075
32232
  ),
32076
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.View, { style: styles13.actionSpacer }),
32233
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.View, { style: styles13.actionSpacer }),
32077
32234
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32078
- import_react_native14.Pressable,
32235
+ import_react_native15.Pressable,
32079
32236
  {
32080
32237
  onPress: handleClose,
32081
32238
  style: [styles13.actionButton, styles13.actionCancel],
32082
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: styles13.actionText, children: t.cancel })
32239
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: styles13.actionText, children: t.cancel })
32083
32240
  }
32084
32241
  ),
32085
32242
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32086
- import_react_native14.Pressable,
32243
+ import_react_native15.Pressable,
32087
32244
  {
32088
32245
  onPress: handleSave,
32089
32246
  style: [
@@ -32091,7 +32248,7 @@ var AnnotationEditor = () => {
32091
32248
  styles13.actionSave,
32092
32249
  { backgroundColor: accentColor }
32093
32250
  ],
32094
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native14.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.save })
32251
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native15.Text, { style: [styles13.actionText, styles13.actionTextLight], children: t.save })
32095
32252
  }
32096
32253
  )
32097
32254
  ] })
@@ -32099,7 +32256,7 @@ var AnnotationEditor = () => {
32099
32256
  }
32100
32257
  );
32101
32258
  };
32102
- var styles13 = import_react_native14.StyleSheet.create({
32259
+ var styles13 = import_react_native15.StyleSheet.create({
32103
32260
  overlay: {
32104
32261
  flex: 1,
32105
32262
  alignItems: "center",
@@ -32176,8 +32333,9 @@ var styles13 = import_react_native14.StyleSheet.create({
32176
32333
  var AnnotationEditor_default = AnnotationEditor;
32177
32334
 
32178
32335
  // components/BottomBar.tsx
32179
- var import_react_native15 = require("react-native");
32180
- var import_core12 = require("@papyrus-sdk/core");
32336
+ var import_react_native16 = require("react-native");
32337
+ var import_core13 = require("@papyrus-sdk/core");
32338
+ var import_react_native_reanimated3 = __toESM(require("react-native-reanimated"));
32181
32339
 
32182
32340
  // components/bottomBarModel.ts
32183
32341
  function buildBottomBarLayout({
@@ -32246,12 +32404,23 @@ var BottomBar = ({
32246
32404
  mobileChromeVisible,
32247
32405
  toolDockOpen,
32248
32406
  activeTool,
32249
- interactionMode,
32250
- nativePdfViewerActive
32251
- } = (0, import_core12.useViewerStore)();
32407
+ interactionMode
32408
+ } = (0, import_core13.useViewerStore)();
32409
+ const inkSession = useNativeInkSession();
32410
+ const supportsInkChrome = documentType === "pdf" && inkSession.supported;
32411
+ const drawing = supportsInkChrome && inkSession.active;
32412
+ const dockVisible = mobileChromeVisible && mobileDockVisible && !drawing;
32413
+ const dockProgress = useNativeInkMotion(dockVisible, supportsInkChrome);
32414
+ const dockMotion = (0, import_react_native_reanimated3.useAnimatedStyle)(() => {
32415
+ "worklet";
32416
+ return {
32417
+ opacity: dockProgress.value,
32418
+ transform: [{ translateY: (1 - dockProgress.value) * 8 }]
32419
+ };
32420
+ });
32252
32421
  const isDark = uiTheme === "dark";
32253
32422
  const t = getStrings(locale);
32254
- const { width, height } = (0, import_react_native15.useWindowDimensions)();
32423
+ const { width, height } = (0, import_react_native16.useWindowDimensions)();
32255
32424
  const isLandscape = width > height;
32256
32425
  const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
32257
32426
  const iconColor = (active) => {
@@ -32268,7 +32437,7 @@ var BottomBar = ({
32268
32437
  label: t.tools,
32269
32438
  icon: IconToolDockTrigger,
32270
32439
  onPress: () => {
32271
- const isNativeIosInkViewer = import_react_native15.Platform.OS === "ios" && Number.parseInt(String(import_react_native15.Platform.Version), 10) >= 16 && nativePdfViewerActive;
32440
+ const isNativeIosInkViewer = supportsInkChrome;
32272
32441
  const action = resolveAnnotateButtonAction({
32273
32442
  isNativeIosInkViewer,
32274
32443
  activeTool,
@@ -32285,13 +32454,7 @@ var BottomBar = ({
32285
32454
  return;
32286
32455
  }
32287
32456
  if (action === "deactivate-native-ink") {
32288
- setDocumentState({
32289
- activeTool: "select",
32290
- interactionMode: "pan",
32291
- nativeInkToolPickerActive: false,
32292
- toolDockOpen: false,
32293
- activeMobileDestination: "none"
32294
- });
32457
+ inkSession.finish();
32295
32458
  return;
32296
32459
  }
32297
32460
  if (action === "dismiss-tool-dock") {
@@ -32329,98 +32492,110 @@ var BottomBar = ({
32329
32492
  onPress: onOpenSettings
32330
32493
  }
32331
32494
  };
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,
32495
+ if (!dockVisible && !supportsInkChrome) return null;
32496
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32497
+ import_react_native_reanimated3.default.View,
32498
+ {
32499
+ pointerEvents: dockVisible ? "box-none" : "none",
32500
+ accessibilityElementsHidden: !dockVisible,
32501
+ importantForAccessibility: dockVisible ? "auto" : "no-hide-descendants",
32502
+ testID: "papyrus-bottom-bar-frame",
32503
+ style: [styles14.frame, { paddingBottom: offsets.bottom, paddingLeft: offsets.left, paddingRight: offsets.right }, dockMotion],
32504
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native16.View, { style: [styles14.row, isLandscape && styles14.rowLandscape], children: [
32505
+ layout.leftSlots.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32506
+ import_react_native16.View,
32507
+ {
32508
+ style: [
32509
+ styles14.island,
32510
+ styles14.editIsland,
32511
+ isDark && styles14.islandDark
32512
+ ],
32513
+ testID: "papyrus-floating-bottom-dock-edit",
32514
+ children: layout.leftSlots.map((slot) => {
32515
+ const meta = slotMeta[slot.key];
32516
+ const Icon = meta.icon;
32517
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32518
+ import_react_native16.Pressable,
32358
32519
  {
32520
+ disabled: !dockVisible,
32521
+ onPress: meta.onPress,
32359
32522
  style: [
32360
- styles14.itemIcon,
32361
- isDark && styles14.itemIconDark,
32362
- slot.active && styles14.itemIconActive
32523
+ styles14.iconOnlyItem,
32524
+ slot.active && styles14.itemActive
32363
32525
  ],
32526
+ accessibilityLabel: meta.label,
32527
+ testID: `papyrus-mobile-destination-${slot.key}`,
32364
32528
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32365
- Icon,
32529
+ import_react_native16.View,
32366
32530
  {
32367
- size: MOBILE_CHROME_METRICS.iconSize,
32368
- color: iconColor(slot.active)
32531
+ style: [
32532
+ styles14.itemIcon,
32533
+ isDark && styles14.itemIconDark,
32534
+ slot.active && styles14.itemIconActive
32535
+ ],
32536
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32537
+ Icon,
32538
+ {
32539
+ size: MOBILE_CHROME_METRICS.iconSize,
32540
+ color: iconColor(slot.active)
32541
+ }
32542
+ )
32369
32543
  }
32370
32544
  )
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,
32545
+ },
32546
+ slot.key
32547
+ );
32548
+ })
32549
+ }
32550
+ ) : null,
32551
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32552
+ import_react_native16.View,
32553
+ {
32554
+ style: [
32555
+ styles14.island,
32556
+ styles14.utilityIsland,
32557
+ isDark && styles14.islandDark
32558
+ ],
32559
+ testID: "papyrus-floating-bottom-dock",
32560
+ children: layout.rightSlots.map((slot) => {
32561
+ const meta = slotMeta[slot.key];
32562
+ const Icon = meta.icon;
32563
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32564
+ import_react_native16.Pressable,
32400
32565
  {
32401
- style: [
32402
- styles14.itemIcon,
32403
- isDark && styles14.itemIconDark,
32404
- slot.active && styles14.itemIconActive
32405
- ],
32566
+ disabled: !dockVisible,
32567
+ onPress: meta.onPress,
32568
+ style: [styles14.iconOnlyItem, slot.active && styles14.itemActive],
32569
+ accessibilityLabel: meta.label,
32570
+ testID: `papyrus-mobile-destination-${slot.key}`,
32406
32571
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32407
- Icon,
32572
+ import_react_native16.View,
32408
32573
  {
32409
- size: MOBILE_CHROME_METRICS.iconSize,
32410
- color: iconColor(slot.active)
32574
+ style: [
32575
+ styles14.itemIcon,
32576
+ isDark && styles14.itemIconDark,
32577
+ slot.active && styles14.itemIconActive
32578
+ ],
32579
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
32580
+ Icon,
32581
+ {
32582
+ size: MOBILE_CHROME_METRICS.iconSize,
32583
+ color: iconColor(slot.active)
32584
+ }
32585
+ )
32411
32586
  }
32412
32587
  )
32413
- }
32414
- )
32415
- },
32416
- slot.key
32417
- );
32418
- })
32419
- }
32420
- )
32421
- ] }) });
32588
+ },
32589
+ slot.key
32590
+ );
32591
+ })
32592
+ }
32593
+ )
32594
+ ] })
32595
+ }
32596
+ );
32422
32597
  };
32423
- var styles14 = import_react_native15.StyleSheet.create({
32598
+ var styles14 = import_react_native16.StyleSheet.create({
32424
32599
  frame: {
32425
32600
  position: "absolute",
32426
32601
  left: 0,
@@ -32500,8 +32675,8 @@ var styles14 = import_react_native15.StyleSheet.create({
32500
32675
  var BottomBar_default = BottomBar;
32501
32676
 
32502
32677
  // components/SettingsSheet.tsx
32503
- var import_react_native16 = require("react-native");
32504
- var import_core13 = require("@papyrus-sdk/core");
32678
+ var import_react_native17 = require("react-native");
32679
+ var import_core14 = require("@papyrus-sdk/core");
32505
32680
 
32506
32681
  // components/rotationReset.ts
32507
32682
  var resetEngineRotation = (engine, onRotationChange) => {
@@ -32527,13 +32702,13 @@ var PAGE_THEME_OPTIONS = [
32527
32702
  ];
32528
32703
  var ThemeSwatch = ({ value }) => {
32529
32704
  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 })
32705
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: [styles15.themeSwatch, styles15.themeSwatchContrast], children: [
32706
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.themeSwatchContrastHalfDark }),
32707
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.themeSwatchContrastHalfLight })
32533
32708
  ] });
32534
32709
  }
32535
32710
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32536
- import_react_native16.View,
32711
+ import_react_native17.View,
32537
32712
  {
32538
32713
  style: [
32539
32714
  styles15.themeSwatch,
@@ -32561,12 +32736,12 @@ var SettingsSheet = ({
32561
32736
  comicLayoutMode,
32562
32737
  comicFitMode,
32563
32738
  comicReadingDirection
32564
- } = (0, import_core13.useViewerStore)();
32739
+ } = (0, import_core14.useViewerStore)();
32565
32740
  const isDark = uiTheme === "dark";
32566
32741
  const isPaged = viewMode === "single";
32567
32742
  const isDouble = viewMode === "double";
32568
32743
  const t = getStrings(locale);
32569
- const { height: windowHeight } = (0, import_react_native16.useWindowDimensions)();
32744
+ const { height: windowHeight } = (0, import_react_native17.useWindowDimensions)();
32570
32745
  const sheetMaxHeight = getSettingsSheetMaxHeight(windowHeight);
32571
32746
  const handleTransition = (mode) => {
32572
32747
  if (mode === "paged") {
@@ -32613,58 +32788,58 @@ var SettingsSheet = ({
32613
32788
  contentContainerStyle: styles15.sheetContent,
32614
32789
  showsVerticalScrollIndicator: false,
32615
32790
  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) => {
32791
+ documentType === "comic" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32792
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicMode }),
32793
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.optionRow, children: ["single", "continuous"].map((mode) => {
32619
32794
  const active = comicLayoutMode === mode;
32620
32795
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32621
- import_react_native16.Pressable,
32796
+ import_react_native17.Pressable,
32622
32797
  {
32623
32798
  onPress: () => setDocumentState({ comicLayoutMode: mode }),
32624
32799
  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 })
32800
+ 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
32801
  },
32627
32802
  mode
32628
32803
  );
32629
32804
  }) }),
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) => {
32805
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicFit }),
32806
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.optionRow, children: ["width", "page"].map((mode) => {
32632
32807
  const active = comicFitMode === mode;
32633
32808
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32634
- import_react_native16.Pressable,
32809
+ import_react_native17.Pressable,
32635
32810
  {
32636
32811
  onPress: () => setDocumentState({ comicFitMode: mode }),
32637
32812
  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 })
32813
+ 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
32814
  },
32640
32815
  mode
32641
32816
  );
32642
32817
  }) }),
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) => {
32818
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.Text, { style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark], children: t.comicDirection }),
32819
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.optionRow, children: ["ltr", "rtl"].map((direction) => {
32645
32820
  const active = comicReadingDirection === direction;
32646
32821
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32647
- import_react_native16.Pressable,
32822
+ import_react_native17.Pressable,
32648
32823
  {
32649
32824
  onPress: () => setDocumentState({ comicReadingDirection: direction }),
32650
32825
  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 })
32826
+ 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
32827
  },
32653
32828
  direction
32654
32829
  );
32655
32830
  }) })
32656
32831
  ] }),
32657
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32832
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32658
32833
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32659
- import_react_native16.Text,
32834
+ import_react_native17.Text,
32660
32835
  {
32661
32836
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32662
32837
  children: t.appearance
32663
32838
  }
32664
32839
  ),
32665
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
32840
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32666
32841
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32667
- import_react_native16.Pressable,
32842
+ import_react_native17.Pressable,
32668
32843
  {
32669
32844
  onPress: () => setDocumentState({ uiTheme: "light" }),
32670
32845
  style: [
@@ -32674,7 +32849,7 @@ var SettingsSheet = ({
32674
32849
  uiTheme === "light" && { backgroundColor: accentColor }
32675
32850
  ],
32676
32851
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32677
- import_react_native16.Text,
32852
+ import_react_native17.Text,
32678
32853
  {
32679
32854
  style: [
32680
32855
  styles15.optionText,
@@ -32687,7 +32862,7 @@ var SettingsSheet = ({
32687
32862
  }
32688
32863
  ),
32689
32864
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32690
- import_react_native16.Pressable,
32865
+ import_react_native17.Pressable,
32691
32866
  {
32692
32867
  onPress: () => setDocumentState({ uiTheme: "dark" }),
32693
32868
  style: [
@@ -32697,7 +32872,7 @@ var SettingsSheet = ({
32697
32872
  uiTheme === "dark" && { backgroundColor: accentColor }
32698
32873
  ],
32699
32874
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32700
- import_react_native16.Text,
32875
+ import_react_native17.Text,
32701
32876
  {
32702
32877
  style: [
32703
32878
  styles15.optionText,
@@ -32711,18 +32886,18 @@ var SettingsSheet = ({
32711
32886
  )
32712
32887
  ] })
32713
32888
  ] }),
32714
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32889
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32715
32890
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32716
- import_react_native16.Text,
32891
+ import_react_native17.Text,
32717
32892
  {
32718
32893
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32719
32894
  children: t.pageTheme
32720
32895
  }
32721
32896
  ),
32722
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native16.View, { style: styles15.themeOptionRow, children: PAGE_THEME_OPTIONS.map((option) => {
32897
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native17.View, { style: styles15.themeOptionRow, children: PAGE_THEME_OPTIONS.map((option) => {
32723
32898
  const active = pageTheme === option.value;
32724
32899
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
32725
- import_react_native16.Pressable,
32900
+ import_react_native17.Pressable,
32726
32901
  {
32727
32902
  onPress: () => setDocumentState({ pageTheme: option.value }),
32728
32903
  style: [
@@ -32734,7 +32909,7 @@ var SettingsSheet = ({
32734
32909
  children: [
32735
32910
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ThemeSwatch, { value: option.value }),
32736
32911
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32737
- import_react_native16.Text,
32912
+ import_react_native17.Text,
32738
32913
  {
32739
32914
  style: [
32740
32915
  styles15.themeOptionLabel,
@@ -32750,17 +32925,17 @@ var SettingsSheet = ({
32750
32925
  );
32751
32926
  }) })
32752
32927
  ] }),
32753
- documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32928
+ documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32754
32929
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32755
- import_react_native16.Text,
32930
+ import_react_native17.Text,
32756
32931
  {
32757
32932
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32758
32933
  children: t.pageTransition
32759
32934
  }
32760
32935
  ),
32761
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
32936
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32762
32937
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32763
- import_react_native16.Pressable,
32938
+ import_react_native17.Pressable,
32764
32939
  {
32765
32940
  onPress: () => handleTransition("continuous"),
32766
32941
  style: [
@@ -32770,7 +32945,7 @@ var SettingsSheet = ({
32770
32945
  (!isPaged || isDouble) && { backgroundColor: accentColor }
32771
32946
  ],
32772
32947
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32773
- import_react_native16.Text,
32948
+ import_react_native17.Text,
32774
32949
  {
32775
32950
  style: [
32776
32951
  styles15.optionText,
@@ -32783,7 +32958,7 @@ var SettingsSheet = ({
32783
32958
  }
32784
32959
  ),
32785
32960
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32786
- import_react_native16.Pressable,
32961
+ import_react_native17.Pressable,
32787
32962
  {
32788
32963
  onPress: () => handleTransition("paged"),
32789
32964
  style: [
@@ -32793,7 +32968,7 @@ var SettingsSheet = ({
32793
32968
  isPaged && { backgroundColor: accentColor }
32794
32969
  ],
32795
32970
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32796
- import_react_native16.Text,
32971
+ import_react_native17.Text,
32797
32972
  {
32798
32973
  style: [
32799
32974
  styles15.optionText,
@@ -32807,17 +32982,17 @@ var SettingsSheet = ({
32807
32982
  )
32808
32983
  ] })
32809
32984
  ] }),
32810
- documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
32985
+ documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32811
32986
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32812
- import_react_native16.Text,
32987
+ import_react_native17.Text,
32813
32988
  {
32814
32989
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32815
32990
  children: t.layout
32816
32991
  }
32817
32992
  ),
32818
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
32993
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32819
32994
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32820
- import_react_native16.Pressable,
32995
+ import_react_native17.Pressable,
32821
32996
  {
32822
32997
  onPress: () => handleLayout("single"),
32823
32998
  style: [
@@ -32827,7 +33002,7 @@ var SettingsSheet = ({
32827
33002
  !isDouble && { backgroundColor: accentColor }
32828
33003
  ],
32829
33004
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32830
- import_react_native16.Text,
33005
+ import_react_native17.Text,
32831
33006
  {
32832
33007
  style: [
32833
33008
  styles15.optionText,
@@ -32840,7 +33015,7 @@ var SettingsSheet = ({
32840
33015
  }
32841
33016
  ),
32842
33017
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32843
- import_react_native16.Pressable,
33018
+ import_react_native17.Pressable,
32844
33019
  {
32845
33020
  onPress: () => handleLayout("double"),
32846
33021
  style: [
@@ -32850,7 +33025,7 @@ var SettingsSheet = ({
32850
33025
  isDouble && { backgroundColor: accentColor }
32851
33026
  ],
32852
33027
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32853
- import_react_native16.Text,
33028
+ import_react_native17.Text,
32854
33029
  {
32855
33030
  style: [
32856
33031
  styles15.optionText,
@@ -32864,22 +33039,22 @@ var SettingsSheet = ({
32864
33039
  )
32865
33040
  ] })
32866
33041
  ] }),
32867
- documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
33042
+ documentType !== "comic" && documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32868
33043
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32869
- import_react_native16.Text,
33044
+ import_react_native17.Text,
32870
33045
  {
32871
33046
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32872
33047
  children: t.rotate
32873
33048
  }
32874
33049
  ),
32875
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
33050
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32876
33051
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32877
- import_react_native16.Pressable,
33052
+ import_react_native17.Pressable,
32878
33053
  {
32879
33054
  onPress: () => handleRotate("counterclockwise"),
32880
33055
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32881
33056
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32882
- import_react_native16.Text,
33057
+ import_react_native17.Text,
32883
33058
  {
32884
33059
  style: [styles15.optionText, isDark && styles15.optionTextDark],
32885
33060
  children: t.counterclockwise
@@ -32887,13 +33062,13 @@ var SettingsSheet = ({
32887
33062
  )
32888
33063
  }
32889
33064
  ),
32890
- import_react_native16.Platform.OS === "ios" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32891
- import_react_native16.Pressable,
33065
+ import_react_native17.Platform.OS === "ios" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
33066
+ import_react_native17.Pressable,
32892
33067
  {
32893
33068
  onPress: handleResetRotation,
32894
33069
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32895
33070
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32896
- import_react_native16.Text,
33071
+ import_react_native17.Text,
32897
33072
  {
32898
33073
  style: [styles15.optionText, isDark && styles15.optionTextDark],
32899
33074
  children: t.rotationOriginal
@@ -32902,12 +33077,12 @@ var SettingsSheet = ({
32902
33077
  }
32903
33078
  ),
32904
33079
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32905
- import_react_native16.Pressable,
33080
+ import_react_native17.Pressable,
32906
33081
  {
32907
33082
  onPress: () => handleRotate("clockwise"),
32908
33083
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32909
33084
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32910
- import_react_native16.Text,
33085
+ import_react_native17.Text,
32911
33086
  {
32912
33087
  style: [styles15.optionText, isDark && styles15.optionTextDark],
32913
33088
  children: t.clockwise
@@ -32917,29 +33092,29 @@ var SettingsSheet = ({
32917
33092
  )
32918
33093
  ] })
32919
33094
  ] }),
32920
- documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
33095
+ documentType !== "text" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32921
33096
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32922
- import_react_native16.Text,
33097
+ import_react_native17.Text,
32923
33098
  {
32924
33099
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32925
33100
  children: t.zoom
32926
33101
  }
32927
33102
  ),
32928
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
33103
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32929
33104
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32930
- import_react_native16.Pressable,
33105
+ import_react_native17.Pressable,
32931
33106
  {
32932
33107
  onPress: () => handleZoom(-0.1),
32933
33108
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
32934
33109
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconZoomOut, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
32935
33110
  }
32936
33111
  ),
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: [
33112
+ /* @__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
33113
  Math.round(zoom * 100),
32939
33114
  "%"
32940
33115
  ] }) }),
32941
33116
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32942
- import_react_native16.Pressable,
33117
+ import_react_native17.Pressable,
32943
33118
  {
32944
33119
  onPress: () => handleZoom(0.1),
32945
33120
  style: [styles15.optionButton, isDark && styles15.optionButtonDark],
@@ -32948,17 +33123,17 @@ var SettingsSheet = ({
32948
33123
  )
32949
33124
  ] })
32950
33125
  ] }),
32951
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.section, children: [
33126
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.section, children: [
32952
33127
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32953
- import_react_native16.Text,
33128
+ import_react_native17.Text,
32954
33129
  {
32955
33130
  style: [styles15.sectionTitle, isDark && styles15.sectionTitleDark],
32956
33131
  children: t.language
32957
33132
  }
32958
33133
  ),
32959
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native16.View, { style: styles15.optionRow, children: [
33134
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native17.View, { style: styles15.optionRow, children: [
32960
33135
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32961
- import_react_native16.Pressable,
33136
+ import_react_native17.Pressable,
32962
33137
  {
32963
33138
  onPress: () => setDocumentState({ locale: "en" }),
32964
33139
  style: [
@@ -32968,7 +33143,7 @@ var SettingsSheet = ({
32968
33143
  locale === "en" && { backgroundColor: accentColor }
32969
33144
  ],
32970
33145
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32971
- import_react_native16.Text,
33146
+ import_react_native17.Text,
32972
33147
  {
32973
33148
  style: [
32974
33149
  styles15.optionText,
@@ -32981,7 +33156,7 @@ var SettingsSheet = ({
32981
33156
  }
32982
33157
  ),
32983
33158
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32984
- import_react_native16.Pressable,
33159
+ import_react_native17.Pressable,
32985
33160
  {
32986
33161
  onPress: () => setDocumentState({ locale: "pt-BR" }),
32987
33162
  style: [
@@ -32991,7 +33166,7 @@ var SettingsSheet = ({
32991
33166
  locale === "pt-BR" && { backgroundColor: accentColor }
32992
33167
  ],
32993
33168
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
32994
- import_react_native16.Text,
33169
+ import_react_native17.Text,
32995
33170
  {
32996
33171
  style: [
32997
33172
  styles15.optionText,
@@ -33011,7 +33186,7 @@ var SettingsSheet = ({
33011
33186
  }
33012
33187
  );
33013
33188
  };
33014
- var styles15 = import_react_native16.StyleSheet.create({
33189
+ var styles15 = import_react_native17.StyleSheet.create({
33015
33190
  sheet: {
33016
33191
  maxHeight: "100%"
33017
33192
  },
@@ -33144,8 +33319,8 @@ var styles15 = import_react_native16.StyleSheet.create({
33144
33319
  var SettingsSheet_default = SettingsSheet;
33145
33320
 
33146
33321
  // components/CoverPreview.tsx
33147
- var import_react16 = require("react");
33148
- var import_react_native17 = require("react-native");
33322
+ var import_react17 = require("react");
33323
+ var import_react_native18 = require("react-native");
33149
33324
  var import_engine_native8 = require("@papyrus-sdk/engine-native");
33150
33325
  var import_jsx_runtime20 = require("react/jsx-runtime");
33151
33326
  var parseDataUri = (value) => {
@@ -33195,18 +33370,18 @@ var CoverPreview = ({
33195
33370
  onLoadEnd,
33196
33371
  onError
33197
33372
  }) => {
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]);
33373
+ const [engine, setEngine] = (0, import_react17.useState)(null);
33374
+ const [layoutReady, setLayoutReady] = (0, import_react17.useState)(false);
33375
+ const [loaded, setLoaded] = (0, import_react17.useState)(false);
33376
+ const [loading, setLoading] = (0, import_react17.useState)(false);
33377
+ const [error, setError] = (0, import_react17.useState)(null);
33378
+ const viewRef = (0, import_react17.useRef)(null);
33379
+ const resolvedType = (0, import_react17.useMemo)(() => inferDocumentType(source, type), [source, type]);
33205
33380
  const isPdf = resolvedType === "pdf";
33206
- const hasNativePageView = Boolean(import_react_native17.UIManager.getViewManagerConfig?.("PapyrusPageView"));
33381
+ const hasNativePageView = Boolean(import_react_native18.UIManager.getViewManagerConfig?.("PapyrusPageView"));
33207
33382
  const canRender = !isPdf || hasNativePageView;
33208
33383
  const shouldRender = Boolean(visible);
33209
- (0, import_react16.useEffect)(() => {
33384
+ (0, import_react17.useEffect)(() => {
33210
33385
  if (!shouldRender) {
33211
33386
  if (!keepAlive) {
33212
33387
  setEngine(null);
@@ -33219,7 +33394,7 @@ var CoverPreview = ({
33219
33394
  setEngine(new import_engine_native8.MobileDocumentEngine());
33220
33395
  }
33221
33396
  }, [shouldRender, keepAlive, engine, canRender]);
33222
- (0, import_react16.useEffect)(() => {
33397
+ (0, import_react17.useEffect)(() => {
33223
33398
  if (!engine || !shouldRender || !canRender) return;
33224
33399
  let active = true;
33225
33400
  setLoading(true);
@@ -33246,13 +33421,13 @@ var CoverPreview = ({
33246
33421
  active = false;
33247
33422
  };
33248
33423
  }, [engine, shouldRender, canRender, source, type, pageIndex, isPdf, onLoadStart, onLoadEnd, onError]);
33249
- (0, import_react16.useEffect)(() => {
33424
+ (0, import_react17.useEffect)(() => {
33250
33425
  if (!engine || !isPdf || !loaded || !layoutReady || !shouldRender || !canRender) return;
33251
- const viewTag = (0, import_react_native17.findNodeHandle)(viewRef.current);
33426
+ const viewTag = (0, import_react_native18.findNodeHandle)(viewRef.current);
33252
33427
  if (!viewTag) return;
33253
33428
  engine.renderPage(pageIndex, viewTag, renderScale);
33254
33429
  }, [engine, isPdf, loaded, layoutReady, shouldRender, canRender, pageIndex, renderScale]);
33255
- (0, import_react16.useEffect)(() => {
33430
+ (0, import_react17.useEffect)(() => {
33256
33431
  return () => {
33257
33432
  engine?.destroy();
33258
33433
  };
@@ -33264,15 +33439,15 @@ var CoverPreview = ({
33264
33439
  }
33265
33440
  };
33266
33441
  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" }) }) });
33442
+ 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
33443
  }
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" }) })
33444
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native18.View, { style: [styles16.container, style], onLayout: handleLayout, children: [
33445
+ /* @__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 }) }),
33446
+ 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" }) }),
33447
+ 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
33448
  ] });
33274
33449
  };
33275
- var styles16 = import_react_native17.StyleSheet.create({
33450
+ var styles16 = import_react_native18.StyleSheet.create({
33276
33451
  container: {
33277
33452
  backgroundColor: "#f8fafc",
33278
33453
  borderRadius: 12,
@@ -33288,13 +33463,13 @@ var styles16 = import_react_native17.StyleSheet.create({
33288
33463
  backgroundColor: "transparent"
33289
33464
  },
33290
33465
  loadingOverlay: {
33291
- ...import_react_native17.StyleSheet.absoluteFillObject,
33466
+ ...import_react_native18.StyleSheet.absoluteFillObject,
33292
33467
  alignItems: "center",
33293
33468
  justifyContent: "center",
33294
33469
  backgroundColor: "rgba(15, 23, 42, 0.15)"
33295
33470
  },
33296
33471
  errorOverlay: {
33297
- ...import_react_native17.StyleSheet.absoluteFillObject,
33472
+ ...import_react_native18.StyleSheet.absoluteFillObject,
33298
33473
  alignItems: "center",
33299
33474
  justifyContent: "center",
33300
33475
  backgroundColor: "rgba(15, 23, 42, 0.4)"
@@ -33319,19 +33494,19 @@ var styles16 = import_react_native17.StyleSheet.create({
33319
33494
  var CoverPreview_default = CoverPreview;
33320
33495
 
33321
33496
  // 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");
33497
+ var import_react20 = __toESM(require("react"));
33498
+ var import_react_native25 = require("react-native");
33499
+ var import_core21 = require("@papyrus-sdk/core");
33325
33500
 
33326
33501
  // components/DocumentActionsSheet.tsx
33327
- var import_react_native18 = require("react-native");
33328
- var import_core14 = require("@papyrus-sdk/core");
33502
+ var import_react_native19 = require("react-native");
33503
+ var import_core15 = require("@papyrus-sdk/core");
33329
33504
  var import_jsx_runtime21 = require("react/jsx-runtime");
33330
33505
  function DocumentActionsSheet({
33331
33506
  visible,
33332
33507
  onClose
33333
33508
  }) {
33334
- const { uiTheme } = (0, import_core14.useViewerStore)();
33509
+ const { uiTheme } = (0, import_core15.useViewerStore)();
33335
33510
  const isDark = uiTheme === "dark";
33336
33511
  const palette = getReaderSheetPalette(isDark);
33337
33512
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -33350,9 +33525,9 @@ function DocumentActionsSheet({
33350
33525
  backgroundColor: palette.surface,
33351
33526
  borderTopColor: palette.divider
33352
33527
  },
33353
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native18.View, { style: styles17.actionList, children: [
33528
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native19.View, { style: styles17.actionList, children: [
33354
33529
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
33355
- import_react_native18.View,
33530
+ import_react_native19.View,
33356
33531
  {
33357
33532
  style: [
33358
33533
  styles17.actionItem,
@@ -33361,11 +33536,11 @@ function DocumentActionsSheet({
33361
33536
  borderColor: palette.divider
33362
33537
  }
33363
33538
  ],
33364
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native18.Text, { style: [styles17.actionText, { color: palette.text }], children: "Share" })
33539
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native19.Text, { style: [styles17.actionText, { color: palette.text }], children: "Share" })
33365
33540
  }
33366
33541
  ),
33367
33542
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
33368
- import_react_native18.View,
33543
+ import_react_native19.View,
33369
33544
  {
33370
33545
  style: [
33371
33546
  styles17.actionItem,
@@ -33374,14 +33549,14 @@ function DocumentActionsSheet({
33374
33549
  borderColor: palette.divider
33375
33550
  }
33376
33551
  ],
33377
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native18.Text, { style: [styles17.actionText, { color: palette.text }], children: "Export" })
33552
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native19.Text, { style: [styles17.actionText, { color: palette.text }], children: "Export" })
33378
33553
  }
33379
33554
  )
33380
33555
  ] })
33381
33556
  }
33382
33557
  );
33383
33558
  }
33384
- var styles17 = import_react_native18.StyleSheet.create({
33559
+ var styles17 = import_react_native19.StyleSheet.create({
33385
33560
  actionList: {
33386
33561
  gap: 10
33387
33562
  },
@@ -33399,8 +33574,8 @@ var styles17 = import_react_native18.StyleSheet.create({
33399
33574
  });
33400
33575
 
33401
33576
  // components/InfoSheet.tsx
33402
- var import_react_native19 = require("react-native");
33403
- var import_core15 = require("@papyrus-sdk/core");
33577
+ var import_react_native20 = require("react-native");
33578
+ var import_core16 = require("@papyrus-sdk/core");
33404
33579
 
33405
33580
  // components/infoSheetModel.ts
33406
33581
  var roundPercent = (value) => Math.max(0, Math.min(100, Math.round(value)));
@@ -33515,7 +33690,7 @@ function InfoSheet({
33515
33690
  viewMode,
33516
33691
  pageTheme,
33517
33692
  locale
33518
- } = (0, import_core15.useViewerStore)();
33693
+ } = (0, import_core16.useViewerStore)();
33519
33694
  const isDark = uiTheme === "dark";
33520
33695
  const palette = getReaderSheetPalette(isDark);
33521
33696
  const isPortuguese = locale === "pt-BR";
@@ -33546,22 +33721,22 @@ function InfoSheet({
33546
33721
  backgroundColor: palette.surface,
33547
33722
  borderTopColor: palette.divider
33548
33723
  },
33549
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native19.View, { style: styles18.sheet, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
33724
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.View, { style: styles18.sheet, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
33550
33725
  NativeSheetScrollView,
33551
33726
  {
33552
33727
  style: styles18.content,
33553
33728
  contentContainerStyle: styles18.contentInner,
33554
33729
  showsVerticalScrollIndicator: false,
33555
33730
  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,
33731
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.Text, { style: [styles18.sectionTitle, { color: palette.mutedText }], children: isPortuguese ? "Resumo do documento" : "Document summary" }),
33732
+ /* @__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)(
33733
+ import_react_native20.View,
33559
33734
  {
33560
33735
  style: [styles18.row, { borderBottomColor: palette.divider }],
33561
33736
  children: [
33562
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native19.Text, { style: [styles18.label, { color: palette.mutedText }], children: row.label }),
33737
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native20.Text, { style: [styles18.label, { color: palette.mutedText }], children: row.label }),
33563
33738
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
33564
- import_react_native19.Text,
33739
+ import_react_native20.Text,
33565
33740
  {
33566
33741
  style: [styles18.value, { color: palette.text }],
33567
33742
  selectable: true,
@@ -33578,7 +33753,7 @@ function InfoSheet({
33578
33753
  }
33579
33754
  );
33580
33755
  }
33581
- var styles18 = import_react_native19.StyleSheet.create({
33756
+ var styles18 = import_react_native20.StyleSheet.create({
33582
33757
  sheet: {
33583
33758
  flex: 1,
33584
33759
  paddingBottom: 16
@@ -33624,8 +33799,8 @@ var styles18 = import_react_native19.StyleSheet.create({
33624
33799
  });
33625
33800
 
33626
33801
  // components/OverflowSheet.tsx
33627
- var import_react_native20 = require("react-native");
33628
- var import_core16 = require("@papyrus-sdk/core");
33802
+ var import_react_native21 = require("react-native");
33803
+ var import_core17 = require("@papyrus-sdk/core");
33629
33804
  var import_jsx_runtime23 = require("react/jsx-runtime");
33630
33805
  var actionLabels = [{ key: "actions", label: "Document actions" }];
33631
33806
  function OverflowSheet({
@@ -33633,7 +33808,7 @@ function OverflowSheet({
33633
33808
  onClose,
33634
33809
  onOpenActions
33635
33810
  }) {
33636
- const isDark = (0, import_core16.useViewerStore)((state) => state.uiTheme === "dark");
33811
+ const isDark = (0, import_core17.useViewerStore)((state) => state.uiTheme === "dark");
33637
33812
  const palette = getReaderSheetPalette(isDark);
33638
33813
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
33639
33814
  NativeSheet,
@@ -33651,8 +33826,8 @@ function OverflowSheet({
33651
33826
  backgroundColor: palette.surface,
33652
33827
  borderTopColor: palette.divider
33653
33828
  },
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,
33829
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native21.View, { style: styles19.actionList, children: actionLabels.map((action) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
33830
+ import_react_native21.Pressable,
33656
33831
  {
33657
33832
  onPress: onOpenActions,
33658
33833
  style: [
@@ -33664,14 +33839,14 @@ function OverflowSheet({
33664
33839
  ],
33665
33840
  accessibilityRole: "button",
33666
33841
  accessibilityLabel: action.label,
33667
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native20.Text, { style: [styles19.actionText, { color: palette.text }], children: action.label })
33842
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native21.Text, { style: [styles19.actionText, { color: palette.text }], children: action.label })
33668
33843
  },
33669
33844
  action.key
33670
33845
  )) })
33671
33846
  }
33672
33847
  );
33673
33848
  }
33674
- var styles19 = import_react_native20.StyleSheet.create({
33849
+ var styles19 = import_react_native21.StyleSheet.create({
33675
33850
  actionList: { gap: 10 },
33676
33851
  actionButton: {
33677
33852
  borderWidth: 1,
@@ -33683,9 +33858,9 @@ var styles19 = import_react_native20.StyleSheet.create({
33683
33858
  });
33684
33859
 
33685
33860
  // 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");
33861
+ var import_react18 = require("react");
33862
+ var import_react_native22 = require("react-native");
33863
+ var import_core18 = require("@papyrus-sdk/core");
33689
33864
 
33690
33865
  // components/progressPillMode.ts
33691
33866
  function resolveProgressPillMode(viewMode, currentPage, pageCount) {
@@ -33721,12 +33896,12 @@ function ProgressPill({
33721
33896
  accentColor,
33722
33897
  mobileChromeVisible,
33723
33898
  mobileProgressPillVisible
33724
- } = (0, import_core17.useViewerStore)();
33899
+ } = (0, import_core18.useViewerStore)();
33725
33900
  const t = getStrings(locale);
33726
33901
  const isDark = uiTheme === "dark";
33727
33902
  const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
33728
- const { height: windowHeight } = (0, import_react_native21.useWindowDimensions)();
33729
- const windowHeightRef = (0, import_react17.useRef)(windowHeight);
33903
+ const { height: windowHeight } = (0, import_react_native22.useWindowDimensions)();
33904
+ const windowHeightRef = (0, import_react18.useRef)(windowHeight);
33730
33905
  windowHeightRef.current = windowHeight;
33731
33906
  const trackHeight = resolvePageScrubberTrackHeight({
33732
33907
  windowHeight,
@@ -33734,32 +33909,32 @@ function ProgressPill({
33734
33909
  bottomOffset: offsets.bottom
33735
33910
  });
33736
33911
  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);
33912
+ const trackYRef = (0, import_react18.useRef)(0);
33913
+ const scrubberRef = (0, import_react18.useRef)(null);
33914
+ const currentPageRef = (0, import_react18.useRef)(currentPage);
33740
33915
  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);
33916
+ const isScrubbingRef = (0, import_react18.useRef)(false);
33917
+ const hasMovedRef = (0, import_react18.useRef)(false);
33918
+ const longPressTriggeredRef = (0, import_react18.useRef)(false);
33919
+ const longPressTimerRef = (0, import_react18.useRef)(null);
33920
+ const pendingReleasedScrubPageRef = (0, import_react18.useRef)(null);
33921
+ const [scrubPreviewPage, setScrubPreviewPage] = (0, import_react18.useState)(null);
33922
+ const onNavigateToPageRef = (0, import_react18.useRef)(onNavigateToPage);
33923
+ const onPressRef = (0, import_react18.useRef)(onPress);
33924
+ const onOpenPageJumpRef = (0, import_react18.useRef)(onOpenPageJump);
33925
+ const onScrubbingChangeRef = (0, import_react18.useRef)(onScrubbingChange);
33751
33926
  onScrubbingChangeRef.current = onScrubbingChange;
33752
- const scrubToPositionRef = (0, import_react17.useRef)(() => {
33927
+ const scrubToPositionRef = (0, import_react18.useRef)(() => {
33753
33928
  });
33754
- const scrubNavigationControllerRef = (0, import_react17.useRef)(
33929
+ const scrubNavigationControllerRef = (0, import_react18.useRef)(
33755
33930
  createPageScrubberNavigationController((page) => {
33756
33931
  onNavigateToPageRef.current?.(page);
33757
33932
  })
33758
33933
  );
33759
- const scrubberResponderRef = (0, import_react17.useRef)(null);
33934
+ const scrubberResponderRef = (0, import_react18.useRef)(null);
33760
33935
  const touchPolicy = resolvePageScrubberTouchPolicy();
33761
33936
  const displayedPage = scrubPreviewPage ?? currentPage;
33762
- const label = (0, import_react17.useMemo)(() => {
33937
+ const label = (0, import_react18.useMemo)(() => {
33763
33938
  const total = Math.max(pageCount, 1);
33764
33939
  const percent = clampPercent(displayedPage / total * 100);
33765
33940
  if (documentType === "pdf") {
@@ -33776,34 +33951,34 @@ function ProgressPill({
33776
33951
  thumbHeight,
33777
33952
  pageCount
33778
33953
  });
33779
- const thumbTopRef = (0, import_react17.useRef)(new import_react_native21.Animated.Value(thumbTop));
33780
- const thumbTopSnapshotRef = (0, import_react17.useRef)(thumbTop);
33954
+ const thumbTopRef = (0, import_react18.useRef)(new import_react_native22.Animated.Value(thumbTop));
33955
+ const thumbTopSnapshotRef = (0, import_react18.useRef)(thumbTop);
33781
33956
  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 });
33957
+ const scrubStartThumbTopRef = (0, import_react18.useRef)(0);
33958
+ const trackReveal = (0, import_react18.useRef)(new import_react_native22.Animated.Value(0)).current;
33959
+ const [trackOriginY, setTrackOriginY] = (0, import_react18.useState)(0);
33960
+ const scrubberMetricsRef = (0, import_react18.useRef)({ trackHeight, thumbHeight, pageCount });
33786
33961
  scrubberMetricsRef.current = { trackHeight, thumbHeight, pageCount };
33787
- (0, import_react17.useEffect)(() => {
33962
+ (0, import_react18.useEffect)(() => {
33788
33963
  onNavigateToPageRef.current = onNavigateToPage;
33789
33964
  }, [onNavigateToPage]);
33790
- (0, import_react17.useEffect)(() => {
33965
+ (0, import_react18.useEffect)(() => {
33791
33966
  onPressRef.current = onPress;
33792
33967
  onOpenPageJumpRef.current = onOpenPageJump;
33793
33968
  }, [onOpenPageJump, onPress]);
33794
- (0, import_react17.useEffect)(() => {
33969
+ (0, import_react18.useEffect)(() => {
33795
33970
  const pendingPage = pendingReleasedScrubPageRef.current;
33796
33971
  if (pendingPage !== null && currentPage === pendingPage) {
33797
33972
  pendingReleasedScrubPageRef.current = null;
33798
33973
  setScrubPreviewPage(null);
33799
33974
  }
33800
33975
  }, [currentPage]);
33801
- (0, import_react17.useEffect)(() => {
33976
+ (0, import_react18.useEffect)(() => {
33802
33977
  if (!isScrubbingRef.current) {
33803
33978
  thumbTopRef.current.setValue(thumbTop);
33804
33979
  }
33805
33980
  }, [thumbTop, thumbTopRef]);
33806
- (0, import_react17.useEffect)(
33981
+ (0, import_react18.useEffect)(
33807
33982
  () => () => {
33808
33983
  if (longPressTimerRef.current !== null) {
33809
33984
  clearTimeout(longPressTimerRef.current);
@@ -33821,19 +33996,19 @@ function ProgressPill({
33821
33996
  if (documentType === "text") {
33822
33997
  const progress = textLength <= 0 ? 0 : clampPercent(currentTextOffset / textLength * 100);
33823
33998
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33824
- import_react_native21.View,
33999
+ import_react_native22.View,
33825
34000
  {
33826
34001
  pointerEvents: "box-none",
33827
34002
  style: [styles20.frame, styles20.singleFrame, { top: offsets.progress, right: offsets.right }],
33828
34003
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33829
- import_react_native21.Pressable,
34004
+ import_react_native22.Pressable,
33830
34005
  {
33831
34006
  accessibilityRole: "button",
33832
34007
  accessibilityLabel: `${t.progress} ${progress}%`,
33833
34008
  onPress: () => onPressRef.current(),
33834
34009
  style: [styles20.singlePill, isDark && styles20.pillDark],
33835
34010
  testID: "papyrus-progress-text",
33836
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native21.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
34011
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
33837
34012
  progress,
33838
34013
  "%"
33839
34014
  ] })
@@ -33848,13 +34023,13 @@ function ProgressPill({
33848
34023
  const previousDisabled = pillMode.previousPage === null || !onNavigateToPage;
33849
34024
  const nextDisabled = pillMode.nextPage === null || !onNavigateToPage;
33850
34025
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33851
- import_react_native21.View,
34026
+ import_react_native22.View,
33852
34027
  {
33853
34028
  pointerEvents: "box-none",
33854
34029
  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: [
34030
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.View, { style: [styles20.singlePill, isDark && styles20.pillDark], children: [
33856
34031
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33857
- import_react_native21.Pressable,
34032
+ import_react_native22.Pressable,
33858
34033
  {
33859
34034
  accessibilityRole: "button",
33860
34035
  accessibilityLabel: t.previousPage,
@@ -33863,18 +34038,18 @@ function ProgressPill({
33863
34038
  onPress: () => pillMode.previousPage !== null && onNavigateToPageRef.current?.(pillMode.previousPage),
33864
34039
  style: styles20.pageArrowHit,
33865
34040
  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" })
34041
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: [styles20.pageArrow, isDark && styles20.labelDark, previousDisabled && styles20.pageArrowDisabled], children: "\u2039" })
33867
34042
  }
33868
34043
  ),
33869
34044
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33870
- import_react_native21.Pressable,
34045
+ import_react_native22.Pressable,
33871
34046
  {
33872
34047
  accessibilityRole: "button",
33873
34048
  accessibilityLabel: `${currentPage}/${pageCount || 0}`,
33874
34049
  onPress: () => onPressRef.current(),
33875
34050
  style: styles20.singlePageCenter,
33876
34051
  testID: "papyrus-progress-page-grid",
33877
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native21.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
34052
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_native22.Text, { style: [styles20.label, isDark && styles20.labelDark], children: [
33878
34053
  currentPage,
33879
34054
  "/",
33880
34055
  pageCount || 0
@@ -33882,7 +34057,7 @@ function ProgressPill({
33882
34057
  }
33883
34058
  ),
33884
34059
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
33885
- import_react_native21.Pressable,
34060
+ import_react_native22.Pressable,
33886
34061
  {
33887
34062
  accessibilityRole: "button",
33888
34063
  accessibilityLabel: t.nextPage,
@@ -33891,7 +34066,7 @@ function ProgressPill({
33891
34066
  onPress: () => pillMode.nextPage !== null && onNavigateToPageRef.current?.(pillMode.nextPage),
33892
34067
  style: styles20.pageArrowHit,
33893
34068
  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" })
34069
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.Text, { style: [styles20.pageArrow, isDark && styles20.labelDark, nextDisabled && styles20.pageArrowDisabled], children: "\u203A" })
33895
34070
  }
33896
34071
  )
33897
34072
  ] })
@@ -33918,7 +34093,7 @@ function ProgressPill({
33918
34093
  };
33919
34094
  scrubToPositionRef.current = scrubToPosition;
33920
34095
  if (scrubberResponderRef.current === null) {
33921
- scrubberResponderRef.current = import_react_native21.PanResponder.create({
34096
+ scrubberResponderRef.current = import_react_native22.PanResponder.create({
33922
34097
  onStartShouldSetPanResponder: () => touchPolicy.claimOnStart,
33923
34098
  onStartShouldSetPanResponderCapture: () => touchPolicy.captureOnStart,
33924
34099
  onMoveShouldSetPanResponder: () => true,
@@ -33938,7 +34113,7 @@ function ProgressPill({
33938
34113
  })
33939
34114
  );
33940
34115
  trackReveal.setValue(0);
33941
- import_react_native21.Animated.timing(trackReveal, {
34116
+ import_react_native22.Animated.timing(trackReveal, {
33942
34117
  toValue: 1,
33943
34118
  duration: 180,
33944
34119
  useNativeDriver: false
@@ -33984,7 +34159,7 @@ function ProgressPill({
33984
34159
  }
33985
34160
  isScrubbingRef.current = false;
33986
34161
  onScrubbingChangeRef.current?.(false);
33987
- import_react_native21.Animated.timing(trackReveal, {
34162
+ import_react_native22.Animated.timing(trackReveal, {
33988
34163
  toValue: 0,
33989
34164
  duration: 140,
33990
34165
  useNativeDriver: false
@@ -34016,7 +34191,7 @@ function ProgressPill({
34016
34191
  }
34017
34192
  isScrubbingRef.current = false;
34018
34193
  onScrubbingChangeRef.current?.(false);
34019
- import_react_native21.Animated.timing(trackReveal, {
34194
+ import_react_native22.Animated.timing(trackReveal, {
34020
34195
  toValue: 0,
34021
34196
  duration: 140,
34022
34197
  useNativeDriver: false
@@ -34032,7 +34207,7 @@ function ProgressPill({
34032
34207
  }
34033
34208
  const responderPanHandlers = scrubberResponderRef.current?.panHandlers ?? {};
34034
34209
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34035
- import_react_native21.View,
34210
+ import_react_native22.View,
34036
34211
  {
34037
34212
  pointerEvents: "box-none",
34038
34213
  style: [
@@ -34044,7 +34219,7 @@ function ProgressPill({
34044
34219
  }
34045
34220
  ],
34046
34221
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
34047
- import_react_native21.View,
34222
+ import_react_native22.View,
34048
34223
  {
34049
34224
  ref: scrubberRef,
34050
34225
  pointerEvents: resolvePageScrubberPointerEvents(),
@@ -34056,7 +34231,7 @@ function ProgressPill({
34056
34231
  },
34057
34232
  children: [
34058
34233
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34059
- import_react_native21.Animated.View,
34234
+ import_react_native22.Animated.View,
34060
34235
  {
34061
34236
  pointerEvents: "none",
34062
34237
  style: [
@@ -34072,12 +34247,12 @@ function ProgressPill({
34072
34247
  }
34073
34248
  ),
34074
34249
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34075
- import_react_native21.Animated.View,
34250
+ import_react_native22.Animated.View,
34076
34251
  {
34077
34252
  pointerEvents: "box-none",
34078
34253
  style: [styles20.thumb, { top: thumbTopRef.current }],
34079
34254
  children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
34080
- import_react_native21.View,
34255
+ import_react_native22.View,
34081
34256
  {
34082
34257
  style: [
34083
34258
  styles20.pill,
@@ -34087,8 +34262,8 @@ function ProgressPill({
34087
34262
  ...responderPanHandlers,
34088
34263
  testID: "papyrus-progress-pill",
34089
34264
  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)(
34265
+ /* @__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 }) }),
34266
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native22.View, { style: styles20.iconHit, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
34092
34267
  IconPageNav,
34093
34268
  {
34094
34269
  size: 20,
@@ -34107,7 +34282,7 @@ function ProgressPill({
34107
34282
  }
34108
34283
  );
34109
34284
  }
34110
- var styles20 = import_react_native21.StyleSheet.create({
34285
+ var styles20 = import_react_native22.StyleSheet.create({
34111
34286
  frame: {
34112
34287
  position: "absolute",
34113
34288
  top: 72,
@@ -34213,9 +34388,9 @@ var styles20 = import_react_native21.StyleSheet.create({
34213
34388
  });
34214
34389
 
34215
34390
  // 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");
34391
+ var import_react19 = __toESM(require("react"));
34392
+ var import_react_native23 = require("react-native");
34393
+ var import_core19 = require("@papyrus-sdk/core");
34219
34394
 
34220
34395
  // components/searchOverlayLayout.ts
34221
34396
  var getSearchOverlayLayout = (windowWidth) => {
@@ -34256,23 +34431,23 @@ function SearchOverlay({
34256
34431
  setSearch,
34257
34432
  uiTheme,
34258
34433
  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);
34434
+ } = (0, import_core19.useViewerStore)();
34435
+ const [draft, setDraft] = (0, import_react19.useState)(searchQuery);
34436
+ const [isSearching, setIsSearching] = (0, import_react19.useState)(false);
34437
+ const searchRequestIdRef = import_react19.default.useRef(0);
34263
34438
  const isDark = uiTheme === "dark";
34264
- const { width: windowWidth } = (0, import_react_native22.useWindowDimensions)();
34439
+ const { width: windowWidth } = (0, import_react_native23.useWindowDimensions)();
34265
34440
  const overlayLayout = getSearchOverlayLayout(windowWidth);
34266
34441
  const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
34267
34442
  const t = getStrings(locale);
34268
- const searchService = (0, import_react18.useMemo)(() => new import_core18.SearchService(engine), [engine]);
34443
+ const searchService = (0, import_react19.useMemo)(() => new import_core19.SearchService(engine), [engine]);
34269
34444
  const results = documentType === "text" ? textSearchResults : searchResults;
34270
- (0, import_react18.useEffect)(() => {
34445
+ (0, import_react19.useEffect)(() => {
34271
34446
  searchService.clearCache();
34272
34447
  }, [isLoaded, pageCount, searchService]);
34273
34448
  const currentCount = results.length > 0 && activeSearchIndex >= 0 ? activeSearchIndex + 1 : 0;
34274
34449
  const targetLabel = documentType === "pdf" ? t.page : documentType === "epub" ? t.contents : t.progress;
34275
- (0, import_react18.useEffect)(() => {
34450
+ (0, import_react19.useEffect)(() => {
34276
34451
  if (!visible) return;
34277
34452
  setDraft(searchQuery);
34278
34453
  }, [searchQuery, visible]);
@@ -34294,13 +34469,13 @@ function SearchOverlay({
34294
34469
  }
34295
34470
  };
34296
34471
  const handleClose = () => {
34297
- import_react_native22.Keyboard.dismiss();
34472
+ import_react_native23.Keyboard.dismiss();
34298
34473
  setSearch("", []);
34299
34474
  onClose();
34300
34475
  };
34301
34476
  if (!visible) return null;
34302
34477
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34303
- import_react_native22.View,
34478
+ import_react_native23.View,
34304
34479
  {
34305
34480
  pointerEvents: "box-none",
34306
34481
  style: [
@@ -34313,16 +34488,16 @@ function SearchOverlay({
34313
34488
  }
34314
34489
  ],
34315
34490
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
34316
- import_react_native22.View,
34491
+ import_react_native23.View,
34317
34492
  {
34318
34493
  style: [styles21.card, overlayLayout.card, isDark && styles21.cardDark],
34319
34494
  testID: "papyrus-search-overlay",
34320
34495
  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: [
34496
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: styles21.inputRow, children: [
34497
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: [styles21.searchInputWrap, isDark && styles21.searchInputWrapDark], children: [
34323
34498
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconSearch, { size: 16, color: isDark ? "#cbd5e1" : "#64748b" }),
34324
34499
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34325
- import_react_native22.TextInput,
34500
+ import_react_native23.TextInput,
34326
34501
  {
34327
34502
  value: draft,
34328
34503
  onChangeText: setDraft,
@@ -34338,18 +34513,18 @@ function SearchOverlay({
34338
34513
  )
34339
34514
  ] }),
34340
34515
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34341
- import_react_native22.Pressable,
34516
+ import_react_native23.Pressable,
34342
34517
  {
34343
34518
  onPress: handleClose,
34344
34519
  style: [styles21.closeButton, isDark && styles21.closeButtonDark],
34345
34520
  accessibilityLabel: "Close search",
34346
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native22.Text, { style: [styles21.closeText, isDark && styles21.closeTextDark], children: t.cancel })
34521
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native23.Text, { style: [styles21.closeText, isDark && styles21.closeTextDark], children: t.cancel })
34347
34522
  }
34348
34523
  )
34349
34524
  ] }),
34350
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native22.View, { style: styles21.metaRow, children: [
34525
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: styles21.metaRow, children: [
34351
34526
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34352
- import_react_native22.Pressable,
34527
+ import_react_native23.Pressable,
34353
34528
  {
34354
34529
  onPress: prevSearchResult,
34355
34530
  disabled: results.length === 0,
@@ -34362,9 +34537,9 @@ function SearchOverlay({
34362
34537
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconChevronLeft, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
34363
34538
  }
34364
34539
  ),
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}` }),
34540
+ /* @__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
34541
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34367
- import_react_native22.Pressable,
34542
+ import_react_native23.Pressable,
34368
34543
  {
34369
34544
  onPress: nextSearchResult,
34370
34545
  disabled: results.length === 0,
@@ -34378,19 +34553,19 @@ function SearchOverlay({
34378
34553
  }
34379
34554
  )
34380
34555
  ] }),
34381
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native22.View, { style: styles21.actionsRow, children: [
34556
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_native23.View, { style: styles21.actionsRow, children: [
34382
34557
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34383
- import_react_native22.Pressable,
34558
+ import_react_native23.Pressable,
34384
34559
  {
34385
34560
  onPress: handleSubmit,
34386
34561
  style: [styles21.primaryAction, { backgroundColor: accentColor }],
34387
34562
  accessibilityLabel: "Run search",
34388
34563
  testID: "papyrus-search-run",
34389
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native22.Text, { style: styles21.primaryActionText, children: t.searchGo })
34564
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_native23.Text, { style: styles21.primaryActionText, children: t.searchGo })
34390
34565
  }
34391
34566
  ),
34392
34567
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34393
- import_react_native22.Pressable,
34568
+ import_react_native23.Pressable,
34394
34569
  {
34395
34570
  onPress: onOpenResults,
34396
34571
  disabled: results.length === 0,
@@ -34401,7 +34576,7 @@ function SearchOverlay({
34401
34576
  ],
34402
34577
  accessibilityLabel: "Open all results",
34403
34578
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
34404
- import_react_native22.Text,
34579
+ import_react_native23.Text,
34405
34580
  {
34406
34581
  style: [
34407
34582
  styles21.secondaryActionText,
@@ -34419,7 +34594,7 @@ function SearchOverlay({
34419
34594
  }
34420
34595
  );
34421
34596
  }
34422
- var styles21 = import_react_native22.StyleSheet.create({
34597
+ var styles21 = import_react_native23.StyleSheet.create({
34423
34598
  frame: {
34424
34599
  position: "absolute",
34425
34600
  left: 0,
@@ -34560,8 +34735,8 @@ var styles21 = import_react_native22.StyleSheet.create({
34560
34735
  });
34561
34736
 
34562
34737
  // components/SearchResultsSheet.tsx
34563
- var import_react_native23 = require("react-native");
34564
- var import_core19 = require("@papyrus-sdk/core");
34738
+ var import_react_native24 = require("react-native");
34739
+ var import_core20 = require("@papyrus-sdk/core");
34565
34740
  var import_jsx_runtime26 = require("react/jsx-runtime");
34566
34741
  function SearchResultsSheet({
34567
34742
  documentType,
@@ -34580,7 +34755,7 @@ function SearchResultsSheet({
34580
34755
  triggerScrollToTextOffset,
34581
34756
  uiTheme,
34582
34757
  accentColor
34583
- } = (0, import_core19.useViewerStore)();
34758
+ } = (0, import_core20.useViewerStore)();
34584
34759
  const results = documentType === "text" ? textSearchResults : searchResults;
34585
34760
  const isDark = uiTheme === "dark";
34586
34761
  const palette = getReaderSheetPalette(isDark);
@@ -34608,16 +34783,16 @@ function SearchResultsSheet({
34608
34783
  borderTopColor: palette.divider
34609
34784
  },
34610
34785
  children: [
34611
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_native23.Text, { style: [styles22.meta, { color: palette.mutedText }], children: [
34786
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_native24.Text, { style: [styles22.meta, { color: palette.mutedText }], children: [
34612
34787
  results.length,
34613
34788
  " ",
34614
34789
  t.results
34615
34790
  ] }),
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) => {
34791
+ /* @__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
34792
  const isActive = index === activeSearchIndex;
34618
34793
  const isTextResult = "kind" in result && result.kind === "text";
34619
34794
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
34620
- import_react_native23.Pressable,
34795
+ import_react_native24.Pressable,
34621
34796
  {
34622
34797
  onPress: () => {
34623
34798
  if (isTextResult) {
@@ -34643,8 +34818,8 @@ function SearchResultsSheet({
34643
34818
  }
34644
34819
  ],
34645
34820
  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 })
34821
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: [styles22.resultLabel, { color: accentColor }], children: isTextResult ? getTextResultLabel(result.location.start) : getResultLabel(result.pageIndex) }),
34822
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: [styles22.resultText, { color: palette.text }], children: result.text })
34648
34823
  ]
34649
34824
  },
34650
34825
  isTextResult ? `text-${result.location.start}-${index}` : `page-${result.pageIndex}-${index}`
@@ -34654,7 +34829,7 @@ function SearchResultsSheet({
34654
34829
  }
34655
34830
  );
34656
34831
  }
34657
- var styles22 = import_react_native23.StyleSheet.create({
34832
+ var styles22 = import_react_native24.StyleSheet.create({
34658
34833
  meta: { fontSize: 12, paddingHorizontal: 18, marginBottom: 10 },
34659
34834
  content: { paddingHorizontal: 18, paddingBottom: 18, gap: 10 },
34660
34835
  emptyText: { fontSize: 13 },
@@ -34694,20 +34869,20 @@ function ReadingShell({
34694
34869
  pageCount,
34695
34870
  uiTheme,
34696
34871
  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);
34872
+ } = (0, import_core21.useViewerStore)();
34873
+ const [overflowOpen, setOverflowOpen] = (0, import_react20.useState)(false);
34874
+ const [infoOpen, setInfoOpen] = (0, import_react20.useState)(false);
34875
+ const [actionsOpen, setActionsOpen] = (0, import_react20.useState)(false);
34876
+ const [settingsOpen, setSettingsOpen] = (0, import_react20.useState)(false);
34877
+ const [searchResultsOpen, setSearchResultsOpen] = (0, import_react20.useState)(false);
34878
+ const [pageJumpOpen, setPageJumpOpen] = (0, import_react20.useState)(false);
34879
+ const [pageScrubActive, setPageScrubActive] = (0, import_react20.useState)(false);
34705
34880
  const isDark = uiTheme === "dark";
34706
- import_react19.default.useEffect(() => {
34707
- const showSubscription = import_react_native24.Keyboard.addListener("keyboardDidShow", () => {
34881
+ import_react20.default.useEffect(() => {
34882
+ const showSubscription = import_react_native25.Keyboard.addListener("keyboardDidShow", () => {
34708
34883
  setMobileKeyboardOpen(true);
34709
34884
  });
34710
- const hideSubscription = import_react_native24.Keyboard.addListener("keyboardDidHide", () => {
34885
+ const hideSubscription = import_react_native25.Keyboard.addListener("keyboardDidHide", () => {
34711
34886
  setMobileKeyboardOpen(false);
34712
34887
  });
34713
34888
  return () => {
@@ -34715,7 +34890,7 @@ function ReadingShell({
34715
34890
  hideSubscription.remove();
34716
34891
  };
34717
34892
  }, [setMobileKeyboardOpen]);
34718
- import_react19.default.useEffect(() => {
34893
+ import_react20.default.useEffect(() => {
34719
34894
  if (sidebarRightOpen) return;
34720
34895
  if (isSidebarBoundDestination(activeMobileDestination)) {
34721
34896
  closeMobileDestination();
@@ -34761,7 +34936,7 @@ function ReadingShell({
34761
34936
  setDocumentState({ currentPage: page });
34762
34937
  triggerScrollToPage(page - 1);
34763
34938
  };
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: [
34939
+ 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
34940
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
34766
34941
  Topbar_default,
34767
34942
  {
@@ -34778,7 +34953,7 @@ function ReadingShell({
34778
34953
  showPageNavigationControls: false
34779
34954
  }
34780
34955
  ),
34781
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native24.View, { style: styles23.viewerStage, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
34956
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native25.View, { style: styles23.viewerStage, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
34782
34957
  Viewer_default,
34783
34958
  {
34784
34959
  engine,
@@ -34818,7 +34993,7 @@ function ReadingShell({
34818
34993
  closeMobileDestination();
34819
34994
  },
34820
34995
  onOpenResults: () => {
34821
- import_react_native24.Keyboard.dismiss();
34996
+ import_react_native25.Keyboard.dismiss();
34822
34997
  setSearchResultsOpen(true);
34823
34998
  closeMobileDestination();
34824
34999
  }
@@ -34903,7 +35078,7 @@ function ReadingShell({
34903
35078
  )
34904
35079
  ] }) });
34905
35080
  }
34906
- var styles23 = import_react_native24.StyleSheet.create({
35081
+ var styles23 = import_react_native25.StyleSheet.create({
34907
35082
  container: {
34908
35083
  flex: 1
34909
35084
  },