@papyrus-sdk/ui-react-native 0.2.13-beta.0 → 0.2.15

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.mjs CHANGED
@@ -21576,7 +21576,7 @@ var PageRenderer = ({
21576
21576
  createdAt: Date.now()
21577
21577
  });
21578
21578
  },
21579
- [addAnnotation, annotationColor, pageIndex]
21579
+ [addAnnotation, annotationColor, logSelectionPerf, pageIndex]
21580
21580
  );
21581
21581
  const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
21582
21582
  const getBoundsFromRects = (rects) => {
@@ -24474,15 +24474,8 @@ var styles3 = StyleSheet3.create({
24474
24474
  var Viewer_default = Viewer;
24475
24475
 
24476
24476
  // components/Topbar.tsx
24477
- import { useEffect as useEffect4, useState as useState3 } from "react";
24478
- import {
24479
- View as View4,
24480
- Text,
24481
- Pressable as Pressable2,
24482
- StyleSheet as StyleSheet4,
24483
- Modal,
24484
- TextInput
24485
- } from "react-native";
24477
+ import { useState as useState4 } from "react";
24478
+ import { View as View5, Text as Text2, Pressable as Pressable3, StyleSheet as StyleSheet5 } from "react-native";
24486
24479
  import { useViewerStore as useViewerStore4 } from "@papyrus-sdk/core";
24487
24480
 
24488
24481
  // icons.tsx
@@ -24825,7 +24818,9 @@ var IconToolInk = ({
24825
24818
  }
24826
24819
  ),
24827
24820
  /* @__PURE__ */ jsx4(Rect, { x: "11", y: "52", width: "16", height: "2", fill: "url(#penBand)" }),
24821
+ /* @__PURE__ */ jsx4(Rect, { x: "11", y: "52", width: "16", height: "2", fill: color, opacity: "0.78" }),
24828
24822
  /* @__PURE__ */ jsx4(Rect, { x: "15", y: "4", width: "8", height: "10", rx: "0.8", fill: "url(#penCap)" }),
24823
+ /* @__PURE__ */ jsx4(Rect, { x: "15", y: "4", width: "8", height: "10", rx: "0.8", fill: color, opacity: "0.72" }),
24829
24824
  /* @__PURE__ */ jsx4(Path, { d: "M18.55 4.6h.9L26.2 40H11.8l6.75-35.4Z", fill: "rgba(255,255,255,0.05)" }),
24830
24825
  /* @__PURE__ */ jsx4(Rect, { x: "11", y: "52", width: "16", height: "2", fill: color, opacity: "0.35" })
24831
24826
  ] });
@@ -24863,7 +24858,15 @@ var IconToolHighlighter = ({
24863
24858
  ),
24864
24859
  /* @__PURE__ */ jsx4(Rect, { x: "7", y: "51.35", width: "24", height: "35", rx: "1.6", fill: "url(#markerBody)" }),
24865
24860
  /* @__PURE__ */ jsx4(Rect, { x: "7", y: "51.35", width: "24", height: "11", rx: "0.8", fill: "url(#markerMetal)" }),
24866
- /* @__PURE__ */ jsx4(Rect, { x: "7", y: "51.35", width: "24", height: "11", rx: "0.8", fill: color, opacity: "0.28" })
24861
+ /* @__PURE__ */ jsx4(Rect, { x: "7", y: "51.35", width: "24", height: "11", rx: "0.8", fill: color, opacity: "0.78" }),
24862
+ /* @__PURE__ */ jsx4(
24863
+ Path,
24864
+ {
24865
+ d: "M13 10.8v5.55h12V5c0-.75-.8-1.23-1.46-.89l-9.46 4.92c-.66.34-1.08 1.03-1.08 1.77Z",
24866
+ fill: color,
24867
+ opacity: "0.72"
24868
+ }
24869
+ )
24867
24870
  ] });
24868
24871
  var IconToolUnderline = ({
24869
24872
  size = 32,
@@ -24898,6 +24901,7 @@ var IconToolUnderline = ({
24898
24901
  /* @__PURE__ */ jsx4(Path, { d: "M8 43.88v-1L15 16.88h8l7 26v1H8Z", fill: "url(#pencilBodyTop)" }),
24899
24902
  /* @__PURE__ */ jsx4(Path, { d: "M8 42.88h22v43H8v-43Z", fill: "url(#pencilBodyBottom)" }),
24900
24903
  /* @__PURE__ */ jsx4(Rect, { x: "8", y: "50.88", width: "22", height: "2", fill: "url(#pencilMetal)" }),
24904
+ /* @__PURE__ */ jsx4(Rect, { x: "8", y: "50.88", width: "22", height: "2", fill: color, opacity: "0.78" }),
24901
24905
  /* @__PURE__ */ jsx4(
24902
24906
  Path,
24903
24907
  {
@@ -24905,6 +24909,14 @@ var IconToolUnderline = ({
24905
24909
  fill: "url(#pencilTip)"
24906
24910
  }
24907
24911
  ),
24912
+ /* @__PURE__ */ jsx4(
24913
+ Path,
24914
+ {
24915
+ d: "M15 16.88 18.03 4.76c.25-1.01 1.69-1.01 1.94 0L23 16.88h-8Z",
24916
+ fill: color,
24917
+ opacity: "0.72"
24918
+ }
24919
+ ),
24908
24920
  /* @__PURE__ */ jsx4(Rect, { x: "8", y: "50.88", width: "22", height: "2", fill: color, opacity: "0.3" })
24909
24921
  ] });
24910
24922
  var IconToolSquiggly = ({
@@ -24975,8 +24987,188 @@ var IconToolNote = ({
24975
24987
  /* @__PURE__ */ jsx4(Line, { x1: "15", y1: "18.2", x2: "19.2", y2: "18.2", stroke: color, strokeWidth: "1.8", strokeLinecap: "round" })
24976
24988
  ] });
24977
24989
 
24990
+ // components/mobileChromeMetrics.ts
24991
+ var MOBILE_CHROME_METRICS = {
24992
+ screenPadding: 16,
24993
+ maxFloatingWidth: 360,
24994
+ maxToolDockWidth: 420,
24995
+ toolDockPaddingTop: 4,
24996
+ toolDockHistoryIconSize: 18,
24997
+ toolDockHistoryGap: 2,
24998
+ toolDockDisabledIconColorDark: "#64748b",
24999
+ toolDockDisabledIconColorLight: "#6b7280",
25000
+ toolDockDisabledOpacity: 0.72,
25001
+ iconSize: 20,
25002
+ iconBoxSize: 28,
25003
+ topbarPageButtonSize: 30,
25004
+ bottomBarItemPaddingHorizontal: 5,
25005
+ bottomBarItemPaddingVertical: 3
25006
+ };
25007
+
25008
+ // components/PageJumpModal.tsx
25009
+ import { useEffect as useEffect4, useState as useState3 } from "react";
25010
+ import { Modal, Pressable as Pressable2, StyleSheet as StyleSheet4, Text, TextInput, View as View4 } from "react-native";
25011
+
25012
+ // components/pageJumpModel.ts
25013
+ var resolvePageJumpTarget = (value, pageCount) => {
25014
+ if (pageCount <= 0) return null;
25015
+ const parsed = Number.parseInt(value, 10);
25016
+ if (Number.isNaN(parsed)) return null;
25017
+ return Math.max(1, Math.min(pageCount, parsed));
25018
+ };
25019
+
25020
+ // components/PageJumpModal.tsx
25021
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
25022
+ function PageJumpModal({
25023
+ visible,
25024
+ currentPage,
25025
+ pageCount,
25026
+ isDark,
25027
+ accentColor,
25028
+ onClose,
25029
+ onConfirm
25030
+ }) {
25031
+ const [value, setValue] = useState3(`${currentPage}`);
25032
+ useEffect4(() => {
25033
+ if (visible) setValue(`${currentPage}`);
25034
+ }, [currentPage, visible]);
25035
+ const confirmJump = () => {
25036
+ const targetPage = resolvePageJumpTarget(value, pageCount);
25037
+ if (targetPage) onConfirm(targetPage);
25038
+ onClose();
25039
+ };
25040
+ return /* @__PURE__ */ jsx5(
25041
+ Modal,
25042
+ {
25043
+ visible,
25044
+ transparent: true,
25045
+ animationType: "fade",
25046
+ onRequestClose: onClose,
25047
+ children: /* @__PURE__ */ jsx5(Pressable2, { style: styles4.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs5(
25048
+ Pressable2,
25049
+ {
25050
+ style: [styles4.card, isDark && styles4.cardDark],
25051
+ onPress: (event) => event.stopPropagation(),
25052
+ children: [
25053
+ /* @__PURE__ */ jsx5(Text, { style: [styles4.title, isDark && styles4.titleDark], children: "Ir para pagina" }),
25054
+ /* @__PURE__ */ jsx5(
25055
+ TextInput,
25056
+ {
25057
+ value,
25058
+ onChangeText: (text) => setValue(text.replace(/[^0-9]/g, "")),
25059
+ keyboardType: "number-pad",
25060
+ autoFocus: true,
25061
+ selectTextOnFocus: true,
25062
+ maxLength: 6,
25063
+ placeholder: "1",
25064
+ placeholderTextColor: isDark ? "#6b7280" : "#9ca3af",
25065
+ style: [styles4.input, isDark && styles4.inputDark],
25066
+ onSubmitEditing: confirmJump,
25067
+ accessibilityLabel: "Page jump input"
25068
+ }
25069
+ ),
25070
+ /* @__PURE__ */ jsxs5(View4, { style: styles4.actions, children: [
25071
+ /* @__PURE__ */ jsx5(
25072
+ Pressable2,
25073
+ {
25074
+ onPress: onClose,
25075
+ style: [
25076
+ styles4.actionButton,
25077
+ styles4.actionCancel,
25078
+ isDark && styles4.actionCancelDark
25079
+ ],
25080
+ children: /* @__PURE__ */ jsx5(Text, { style: [styles4.actionText, isDark && styles4.actionTextDark], children: "Cancelar" })
25081
+ }
25082
+ ),
25083
+ /* @__PURE__ */ jsx5(
25084
+ Pressable2,
25085
+ {
25086
+ onPress: confirmJump,
25087
+ style: [styles4.actionButton, { backgroundColor: accentColor }],
25088
+ children: /* @__PURE__ */ jsx5(Text, { style: [styles4.actionText, styles4.actionTextPrimary], children: "Ir" })
25089
+ }
25090
+ )
25091
+ ] })
25092
+ ]
25093
+ }
25094
+ ) })
25095
+ }
25096
+ );
25097
+ }
25098
+ var styles4 = StyleSheet4.create({
25099
+ backdrop: {
25100
+ flex: 1,
25101
+ backgroundColor: "rgba(15, 23, 42, 0.4)",
25102
+ alignItems: "center",
25103
+ justifyContent: "center",
25104
+ padding: 24
25105
+ },
25106
+ card: {
25107
+ width: "100%",
25108
+ maxWidth: 320,
25109
+ borderRadius: 24,
25110
+ backgroundColor: "#ffffff",
25111
+ padding: 18,
25112
+ gap: 12
25113
+ },
25114
+ cardDark: {
25115
+ backgroundColor: "#0f1115"
25116
+ },
25117
+ title: {
25118
+ fontSize: 16,
25119
+ fontWeight: "800",
25120
+ color: "#111827"
25121
+ },
25122
+ titleDark: {
25123
+ color: "#f8fafc"
25124
+ },
25125
+ input: {
25126
+ borderRadius: 14,
25127
+ borderWidth: 1,
25128
+ borderColor: "#d1d5db",
25129
+ paddingHorizontal: 14,
25130
+ paddingVertical: 10,
25131
+ fontSize: 18,
25132
+ fontWeight: "800",
25133
+ color: "#111827",
25134
+ textAlign: "center"
25135
+ },
25136
+ inputDark: {
25137
+ backgroundColor: "#111827",
25138
+ borderColor: "#374151",
25139
+ color: "#f8fafc"
25140
+ },
25141
+ actions: {
25142
+ flexDirection: "row",
25143
+ justifyContent: "flex-end",
25144
+ gap: 10
25145
+ },
25146
+ actionButton: {
25147
+ borderRadius: 999,
25148
+ paddingHorizontal: 14,
25149
+ paddingVertical: 9
25150
+ },
25151
+ actionCancel: {
25152
+ backgroundColor: "#e5e7eb"
25153
+ },
25154
+ actionCancelDark: {
25155
+ backgroundColor: "#111827"
25156
+ },
25157
+ actionText: {
25158
+ fontSize: 12,
25159
+ fontWeight: "800",
25160
+ color: "#111827"
25161
+ },
25162
+ actionTextDark: {
25163
+ color: "#e5e7eb"
25164
+ },
25165
+ actionTextPrimary: {
25166
+ color: "#ffffff"
25167
+ }
25168
+ });
25169
+
24978
25170
  // components/Topbar.tsx
24979
- import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
25171
+ import { Fragment, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
24980
25172
  var Topbar = ({
24981
25173
  engine,
24982
25174
  onOpenSettings,
@@ -24985,7 +25177,8 @@ var Topbar = ({
24985
25177
  logo,
24986
25178
  onLogoPress,
24987
25179
  logoAccessibilityLabel = "Logo",
24988
- showPageNavigationControls = false
25180
+ showPageNavigationControls = false,
25181
+ onOpenPageJump
24989
25182
  }) => {
24990
25183
  const {
24991
25184
  currentPage,
@@ -24996,17 +25189,9 @@ var Topbar = ({
24996
25189
  accentColor,
24997
25190
  mobileChromeVisible
24998
25191
  } = useViewerStore4();
24999
- const [pageLabel, setPageLabel] = useState3(`${currentPage}`);
25000
- const [jumpModalOpen, setJumpModalOpen] = useState3(false);
25001
- const [jumpValue, setJumpValue] = useState3(`${currentPage}`);
25192
+ const [jumpModalOpen, setJumpModalOpen] = useState4(false);
25002
25193
  const isDark = uiTheme === "dark";
25003
25194
  const navIconColor = isDark ? "#e5e7eb" : "#111827";
25004
- useEffect4(() => {
25005
- setPageLabel(`${currentPage}`);
25006
- if (!jumpModalOpen) {
25007
- setJumpValue(`${currentPage}`);
25008
- }
25009
- }, [currentPage, jumpModalOpen]);
25010
25195
  const navigateToPage = (targetPage) => {
25011
25196
  const next = Math.max(1, Math.min(pageCount, targetPage));
25012
25197
  engine.goToPage(next);
@@ -25017,73 +25202,82 @@ var Topbar = ({
25017
25202
  navigateToPage(currentPage + delta);
25018
25203
  };
25019
25204
  const openJumpModal = () => {
25020
- setJumpValue(`${currentPage}`);
25021
- setJumpModalOpen(true);
25022
- };
25023
- const confirmJump = () => {
25024
- const parsed = Number.parseInt(jumpValue, 10);
25025
- if (Number.isNaN(parsed)) {
25026
- setJumpModalOpen(false);
25205
+ if (onOpenPageJump) {
25206
+ onOpenPageJump();
25027
25207
  return;
25028
25208
  }
25029
- navigateToPage(parsed);
25030
- setJumpModalOpen(false);
25209
+ setJumpModalOpen(true);
25031
25210
  };
25032
- const defaultLogo = /* @__PURE__ */ jsx5(View4, { style: [styles4.logoBadge, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsx5(Text, { style: styles4.logoText, children: "P" }) });
25211
+ const defaultLogo = /* @__PURE__ */ jsx6(View5, { style: [styles5.logoBadge, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsx6(Text2, { style: styles5.logoText, children: "P" }) });
25033
25212
  const logoElement = logo ?? defaultLogo;
25034
25213
  if (!mobileChromeVisible) return null;
25035
- return /* @__PURE__ */ jsxs5(Fragment, { children: [
25036
- /* @__PURE__ */ jsx5(
25037
- View4,
25214
+ return /* @__PURE__ */ jsxs6(Fragment, { children: [
25215
+ /* @__PURE__ */ jsx6(
25216
+ View5,
25038
25217
  {
25039
- style: [styles4.chromeFrame],
25218
+ style: [styles5.chromeFrame],
25040
25219
  pointerEvents: "box-none",
25041
25220
  testID: "papyrus-floating-top-controls",
25042
- children: /* @__PURE__ */ jsxs5(View4, { style: [styles4.container, isDark && styles4.containerDark], children: [
25043
- /* @__PURE__ */ jsxs5(View4, { style: styles4.leftGroup, children: [
25044
- onLogoPress ? /* @__PURE__ */ jsx5(
25045
- Pressable2,
25221
+ children: /* @__PURE__ */ jsxs6(View5, { style: [styles5.container, isDark && styles5.containerDark], children: [
25222
+ /* @__PURE__ */ jsxs6(View5, { style: styles5.leftGroup, children: [
25223
+ onLogoPress ? /* @__PURE__ */ jsx6(
25224
+ Pressable3,
25046
25225
  {
25047
25226
  onPress: onLogoPress,
25048
25227
  accessibilityRole: "button",
25049
25228
  accessibilityLabel: logoAccessibilityLabel,
25050
- style: styles4.logoSlot,
25229
+ style: styles5.logoSlot,
25051
25230
  children: logoElement
25052
25231
  }
25053
- ) : /* @__PURE__ */ jsx5(View4, { style: styles4.logoSlot, children: logoElement }),
25054
- /* @__PURE__ */ jsx5(
25055
- Text,
25232
+ ) : /* @__PURE__ */ jsx6(View5, { style: styles5.logoSlot, children: logoElement }),
25233
+ /* @__PURE__ */ jsx6(
25234
+ Pressable3,
25056
25235
  {
25057
- numberOfLines: 1,
25058
- style: [styles4.brandText, isDark && styles4.brandTextDark],
25059
- children: title ?? "Papyrus"
25236
+ onPress: openJumpModal,
25237
+ disabled: pageCount <= 0,
25238
+ style: styles5.titleHit,
25239
+ accessibilityLabel: "Open page jump",
25240
+ children: /* @__PURE__ */ jsx6(
25241
+ Text2,
25242
+ {
25243
+ numberOfLines: 1,
25244
+ style: [styles5.brandText, isDark && styles5.brandTextDark],
25245
+ children: title ?? "Papyrus"
25246
+ }
25247
+ )
25060
25248
  }
25061
25249
  )
25062
25250
  ] }),
25063
- showPageNavigationControls ? /* @__PURE__ */ jsx5(View4, { style: styles4.pageGroup, children: /* @__PURE__ */ jsxs5(Fragment, { children: [
25064
- /* @__PURE__ */ jsx5(
25065
- Pressable2,
25251
+ showPageNavigationControls ? /* @__PURE__ */ jsx6(View5, { style: styles5.pageGroup, children: /* @__PURE__ */ jsxs6(Fragment, { children: [
25252
+ /* @__PURE__ */ jsx6(
25253
+ Pressable3,
25066
25254
  {
25067
25255
  onPress: () => handlePageChange(-1),
25068
- style: [styles4.pageButton, isDark && styles4.pageButtonDark],
25069
- children: /* @__PURE__ */ jsx5(IconChevronLeft, { size: 16, color: navIconColor })
25256
+ style: [styles5.pageButton, isDark && styles5.pageButtonDark],
25257
+ children: /* @__PURE__ */ jsx6(
25258
+ IconChevronLeft,
25259
+ {
25260
+ size: MOBILE_CHROME_METRICS.iconSize,
25261
+ color: navIconColor
25262
+ }
25263
+ )
25070
25264
  }
25071
25265
  ),
25072
- /* @__PURE__ */ jsx5(
25073
- Pressable2,
25266
+ /* @__PURE__ */ jsx6(
25267
+ Pressable3,
25074
25268
  {
25075
25269
  onPress: openJumpModal,
25076
- style: styles4.pageIndicatorHit,
25270
+ style: styles5.pageIndicatorHit,
25077
25271
  accessibilityLabel: "Page jump",
25078
- children: /* @__PURE__ */ jsxs5(
25079
- Text,
25272
+ children: /* @__PURE__ */ jsxs6(
25273
+ Text2,
25080
25274
  {
25081
25275
  style: [
25082
- styles4.pageIndicator,
25083
- isDark && styles4.pageIndicatorDark
25276
+ styles5.pageIndicator,
25277
+ isDark && styles5.pageIndicatorDark
25084
25278
  ],
25085
25279
  children: [
25086
- pageLabel,
25280
+ currentPage,
25087
25281
  "/",
25088
25282
  pageCount
25089
25283
  ]
@@ -25091,123 +25285,57 @@ var Topbar = ({
25091
25285
  )
25092
25286
  }
25093
25287
  ),
25094
- /* @__PURE__ */ jsx5(
25095
- Pressable2,
25288
+ /* @__PURE__ */ jsx6(
25289
+ Pressable3,
25096
25290
  {
25097
25291
  onPress: () => handlePageChange(1),
25098
- style: [styles4.pageButton, isDark && styles4.pageButtonDark],
25099
- children: /* @__PURE__ */ jsx5(IconChevronRight, { size: 16, color: navIconColor })
25292
+ style: [styles5.pageButton, isDark && styles5.pageButtonDark],
25293
+ children: /* @__PURE__ */ jsx6(
25294
+ IconChevronRight,
25295
+ {
25296
+ size: MOBILE_CHROME_METRICS.iconSize,
25297
+ color: navIconColor
25298
+ }
25299
+ )
25100
25300
  }
25101
25301
  )
25102
25302
  ] }) }) : null,
25103
- /* @__PURE__ */ jsx5(View4, { style: styles4.rightGroup, children: /* @__PURE__ */ jsx5(
25104
- Pressable2,
25303
+ /* @__PURE__ */ jsx6(View5, { style: styles5.rightGroup, children: /* @__PURE__ */ jsx6(
25304
+ Pressable3,
25105
25305
  {
25106
25306
  onPress: () => onOpenOverflow?.() ?? onOpenSettings?.(),
25107
- style: [styles4.iconButton, isDark && styles4.iconButtonDark],
25307
+ style: [styles5.iconButton, isDark && styles5.iconButtonDark],
25108
25308
  accessibilityLabel: "Open overflow menu",
25109
- children: /* @__PURE__ */ jsx5(IconSettings, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
25309
+ children: /* @__PURE__ */ jsx6(
25310
+ IconSettings,
25311
+ {
25312
+ size: MOBILE_CHROME_METRICS.iconSize,
25313
+ color: isDark ? "#e5e7eb" : "#111827"
25314
+ }
25315
+ )
25110
25316
  }
25111
25317
  ) })
25112
25318
  ] })
25113
25319
  }
25114
25320
  ),
25115
- /* @__PURE__ */ jsx5(
25116
- Modal,
25321
+ /* @__PURE__ */ jsx6(
25322
+ PageJumpModal,
25117
25323
  {
25118
25324
  visible: jumpModalOpen,
25119
- transparent: true,
25120
- animationType: "fade",
25121
- onRequestClose: () => setJumpModalOpen(false),
25122
- children: /* @__PURE__ */ jsx5(
25123
- Pressable2,
25124
- {
25125
- style: styles4.jumpModalBackdrop,
25126
- onPress: () => setJumpModalOpen(false),
25127
- children: /* @__PURE__ */ jsxs5(
25128
- Pressable2,
25129
- {
25130
- style: [styles4.jumpModalCard, isDark && styles4.jumpModalCardDark],
25131
- onPress: (event) => event.stopPropagation(),
25132
- children: [
25133
- /* @__PURE__ */ jsx5(
25134
- Text,
25135
- {
25136
- style: [
25137
- styles4.jumpModalTitle,
25138
- isDark && styles4.jumpModalTitleDark
25139
- ],
25140
- children: "Ir para p\xE1gina"
25141
- }
25142
- ),
25143
- /* @__PURE__ */ jsx5(
25144
- TextInput,
25145
- {
25146
- value: jumpValue,
25147
- onChangeText: (text) => setJumpValue(text.replace(/[^0-9]/g, "")),
25148
- keyboardType: "number-pad",
25149
- autoFocus: true,
25150
- selectTextOnFocus: true,
25151
- maxLength: 6,
25152
- placeholder: "1",
25153
- placeholderTextColor: isDark ? "#6b7280" : "#9ca3af",
25154
- style: [styles4.jumpInput, isDark && styles4.jumpInputDark],
25155
- onSubmitEditing: confirmJump,
25156
- accessibilityLabel: "Page jump input"
25157
- }
25158
- ),
25159
- /* @__PURE__ */ jsxs5(View4, { style: styles4.jumpActions, children: [
25160
- /* @__PURE__ */ jsx5(
25161
- Pressable2,
25162
- {
25163
- onPress: () => setJumpModalOpen(false),
25164
- style: [
25165
- styles4.jumpActionButton,
25166
- styles4.jumpActionCancel,
25167
- isDark && styles4.jumpActionCancelDark
25168
- ],
25169
- children: /* @__PURE__ */ jsx5(
25170
- Text,
25171
- {
25172
- style: [
25173
- styles4.jumpActionText,
25174
- isDark && styles4.jumpActionTextDark
25175
- ],
25176
- children: "Cancelar"
25177
- }
25178
- )
25179
- }
25180
- ),
25181
- /* @__PURE__ */ jsx5(
25182
- Pressable2,
25183
- {
25184
- onPress: confirmJump,
25185
- style: [
25186
- styles4.jumpActionButton,
25187
- { backgroundColor: accentColor }
25188
- ],
25189
- children: /* @__PURE__ */ jsx5(
25190
- Text,
25191
- {
25192
- style: [styles4.jumpActionText, styles4.jumpActionTextPrimary],
25193
- children: "Ir"
25194
- }
25195
- )
25196
- }
25197
- )
25198
- ] })
25199
- ]
25200
- }
25201
- )
25202
- }
25203
- )
25325
+ currentPage,
25326
+ pageCount,
25327
+ isDark,
25328
+ accentColor,
25329
+ onClose: () => setJumpModalOpen(false),
25330
+ onConfirm: navigateToPage
25204
25331
  }
25205
25332
  )
25206
25333
  ] });
25207
25334
  };
25208
- var styles4 = StyleSheet4.create({
25335
+ var styles5 = StyleSheet5.create({
25209
25336
  container: {
25210
- marginHorizontal: 12,
25337
+ width: "100%",
25338
+ maxWidth: MOBILE_CHROME_METRICS.maxFloatingWidth,
25211
25339
  marginTop: 10,
25212
25340
  paddingHorizontal: 14,
25213
25341
  paddingVertical: 10,
@@ -25232,7 +25360,9 @@ var styles4 = StyleSheet4.create({
25232
25360
  top: 0,
25233
25361
  left: 0,
25234
25362
  right: 0,
25235
- zIndex: 20
25363
+ zIndex: 20,
25364
+ paddingHorizontal: MOBILE_CHROME_METRICS.screenPadding,
25365
+ alignItems: "center"
25236
25366
  },
25237
25367
  leftGroup: {
25238
25368
  flexDirection: "row",
@@ -25267,6 +25397,12 @@ var styles4 = StyleSheet4.create({
25267
25397
  brandTextDark: {
25268
25398
  color: "#f9fafb"
25269
25399
  },
25400
+ titleHit: {
25401
+ flexShrink: 1,
25402
+ flexGrow: 1,
25403
+ minWidth: 0,
25404
+ borderRadius: 8
25405
+ },
25270
25406
  pageGroup: {
25271
25407
  flexDirection: "row",
25272
25408
  alignItems: "center",
@@ -25274,8 +25410,8 @@ var styles4 = StyleSheet4.create({
25274
25410
  justifyContent: "center"
25275
25411
  },
25276
25412
  pageButton: {
25277
- width: 26,
25278
- height: 26,
25413
+ width: MOBILE_CHROME_METRICS.topbarPageButtonSize,
25414
+ height: MOBILE_CHROME_METRICS.topbarPageButtonSize,
25279
25415
  borderRadius: 10,
25280
25416
  alignItems: "center",
25281
25417
  justifyContent: "center",
@@ -25345,90 +25481,17 @@ var styles4 = StyleSheet4.create({
25345
25481
  },
25346
25482
  iconRowSpacer: {
25347
25483
  width: 6
25348
- },
25349
- jumpModalBackdrop: {
25350
- flex: 1,
25351
- backgroundColor: "rgba(0, 0, 0, 0.35)",
25352
- alignItems: "center",
25353
- justifyContent: "center",
25354
- paddingHorizontal: 24
25355
- },
25356
- jumpModalCard: {
25357
- width: "100%",
25358
- maxWidth: 280,
25359
- backgroundColor: "#ffffff",
25360
- borderRadius: 14,
25361
- borderWidth: 1,
25362
- borderColor: "#e5e7eb",
25363
- padding: 14
25364
- },
25365
- jumpModalCardDark: {
25366
- backgroundColor: "#0f1115",
25367
- borderColor: "#1f2937"
25368
- },
25369
- jumpModalTitle: {
25370
- fontSize: 13,
25371
- fontWeight: "700",
25372
- color: "#111827",
25373
- marginBottom: 10
25374
- },
25375
- jumpModalTitleDark: {
25376
- color: "#f3f4f6"
25377
- },
25378
- jumpInput: {
25379
- borderWidth: 1,
25380
- borderColor: "#d1d5db",
25381
- borderRadius: 10,
25382
- paddingHorizontal: 12,
25383
- paddingVertical: 8,
25384
- fontSize: 15,
25385
- color: "#111827",
25386
- marginBottom: 12
25387
- },
25388
- jumpInputDark: {
25389
- borderColor: "#374151",
25390
- color: "#f3f4f6",
25391
- backgroundColor: "#111827"
25392
- },
25393
- jumpActions: {
25394
- flexDirection: "row",
25395
- justifyContent: "flex-end"
25396
- },
25397
- jumpActionButton: {
25398
- paddingHorizontal: 12,
25399
- paddingVertical: 8,
25400
- borderRadius: 8,
25401
- marginLeft: 8,
25402
- minWidth: 64,
25403
- alignItems: "center"
25404
- },
25405
- jumpActionCancel: {
25406
- backgroundColor: "#f3f4f6"
25407
- },
25408
- jumpActionCancelDark: {
25409
- backgroundColor: "#111827"
25410
- },
25411
- jumpActionText: {
25412
- fontSize: 12,
25413
- fontWeight: "700",
25414
- color: "#111827"
25415
- },
25416
- jumpActionTextDark: {
25417
- color: "#e5e7eb"
25418
- },
25419
- jumpActionTextPrimary: {
25420
- color: "#ffffff"
25421
25484
  }
25422
25485
  });
25423
25486
  var Topbar_default = Topbar;
25424
25487
 
25425
25488
  // components/ToolDock.tsx
25426
- import React5, { useEffect as useEffect5, useMemo as useMemo4, useRef as useRef4, useState as useState4 } from "react";
25489
+ import React6, { useEffect as useEffect5, useMemo as useMemo4, useRef as useRef4, useState as useState5 } from "react";
25427
25490
  import {
25428
- View as View5,
25429
- Text as Text2,
25430
- Pressable as Pressable3,
25431
- StyleSheet as StyleSheet5,
25491
+ View as View6,
25492
+ Text as Text3,
25493
+ Pressable as Pressable4,
25494
+ StyleSheet as StyleSheet6,
25432
25495
  ScrollView as ScrollView3,
25433
25496
  useWindowDimensions as useWindowDimensions3
25434
25497
  } from "react-native";
@@ -25564,9 +25627,27 @@ var getStrings = (locale) => STRINGS[locale ?? "en"] ?? STRINGS.en;
25564
25627
  // components/ToolDock.layout.ts
25565
25628
  var TOOL_DOCK_SCROLL_THRESHOLD = 420;
25566
25629
  var shouldUseScrollablePrimaryToolsRow = (windowWidth) => windowWidth < TOOL_DOCK_SCROLL_THRESHOLD;
25630
+ var DRAWING_TOOL_IDS = /* @__PURE__ */ new Set(["ink", "highlight", "underline"]);
25631
+ var resolveToolDockBaseIconColor = ({
25632
+ label,
25633
+ isDark
25634
+ }) => {
25635
+ if (label === "note") return "#f4c430";
25636
+ return isDark ? "#f8fafc" : "#111827";
25637
+ };
25638
+ var resolveToolDockIconColor = ({
25639
+ toolId,
25640
+ isSelected,
25641
+ annotationColor,
25642
+ accentColor,
25643
+ baseIconColor
25644
+ }) => {
25645
+ if (!isSelected) return baseIconColor;
25646
+ return DRAWING_TOOL_IDS.has(toolId) ? annotationColor : accentColor;
25647
+ };
25567
25648
 
25568
25649
  // components/ToolDock.tsx
25569
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
25650
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
25570
25651
  var COLOR_SWATCHES = [
25571
25652
  "#fbbf24",
25572
25653
  "#f97316",
@@ -25616,10 +25697,7 @@ var OPACITY_TRACK_PADDING = 6;
25616
25697
  var OPACITY_THUMB_SIZE = 22;
25617
25698
  var OPACITY_RAIL_HEIGHT = 10;
25618
25699
  var getToolAccentColor = (tool, isDark) => {
25619
- if (tool.label === "highlight" || tool.label === "note") {
25620
- return "#f4c430";
25621
- }
25622
- return isDark ? "#f8fafc" : "#111827";
25700
+ return resolveToolDockBaseIconColor({ label: tool.label, isDark });
25623
25701
  };
25624
25702
  var getToolVisual = (toolId) => {
25625
25703
  switch (toolId) {
@@ -25640,14 +25718,14 @@ var getToolVisual = (toolId) => {
25640
25718
  return { width: 24, iconSize: 28, offsetY: 6 };
25641
25719
  }
25642
25720
  };
25643
- var OpacitySlider = React5.memo(function OpacitySlider2({
25721
+ var OpacitySlider = React6.memo(function OpacitySlider2({
25644
25722
  value,
25645
25723
  color,
25646
25724
  isDark,
25647
25725
  onCommit
25648
25726
  }) {
25649
- const [trackWidth, setTrackWidth] = useState4(0);
25650
- const [draftValue, setDraftValue] = useState4(value);
25727
+ const [trackWidth, setTrackWidth] = useState5(0);
25728
+ const [draftValue, setDraftValue] = useState5(value);
25651
25729
  const dragValueRef = useRef4(draftValue);
25652
25730
  const isDraggingRef = useRef4(false);
25653
25731
  const frameRef = useRef4(null);
@@ -25694,10 +25772,10 @@ var OpacitySlider = React5.memo(function OpacitySlider2({
25694
25772
  setDraftValue(next);
25695
25773
  onCommit(next);
25696
25774
  };
25697
- return /* @__PURE__ */ jsx6(View5, { style: styles5.opacitySliderWrap, children: /* @__PURE__ */ jsxs6(
25698
- View5,
25775
+ return /* @__PURE__ */ jsx7(View6, { style: styles6.opacitySliderWrap, children: /* @__PURE__ */ jsxs7(
25776
+ View6,
25699
25777
  {
25700
- style: styles5.opacityTouchSurface,
25778
+ style: styles6.opacityTouchSurface,
25701
25779
  onLayout: (event) => setTrackWidth(event.nativeEvent.layout.width),
25702
25780
  onStartShouldSetResponder: () => true,
25703
25781
  onMoveShouldSetResponder: () => true,
@@ -25706,12 +25784,12 @@ var OpacitySlider = React5.memo(function OpacitySlider2({
25706
25784
  onResponderRelease: commitDraft,
25707
25785
  onResponderTerminate: () => commitDraft(),
25708
25786
  children: [
25709
- /* @__PURE__ */ jsx6(View5, { style: styles5.opacityTrack }),
25710
- /* @__PURE__ */ jsx6(
25711
- View5,
25787
+ /* @__PURE__ */ jsx7(View6, { style: styles6.opacityTrack }),
25788
+ /* @__PURE__ */ jsx7(
25789
+ View6,
25712
25790
  {
25713
25791
  style: [
25714
- styles5.opacityTrackFill,
25792
+ styles6.opacityTrackFill,
25715
25793
  {
25716
25794
  width: fillWidth,
25717
25795
  backgroundColor: withInkAlpha(color, 0.92)
@@ -25719,11 +25797,11 @@ var OpacitySlider = React5.memo(function OpacitySlider2({
25719
25797
  ]
25720
25798
  }
25721
25799
  ),
25722
- /* @__PURE__ */ jsx6(
25723
- View5,
25800
+ /* @__PURE__ */ jsx7(
25801
+ View6,
25724
25802
  {
25725
25803
  style: [
25726
- styles5.opacityThumb,
25804
+ styles6.opacityThumb,
25727
25805
  {
25728
25806
  left: thumbOffset,
25729
25807
  borderColor: isDark ? "#0f172a" : "#ffffff"
@@ -25756,8 +25834,8 @@ var ToolDock = () => {
25756
25834
  undoAnnotations,
25757
25835
  redoAnnotations
25758
25836
  } = useViewerStore5();
25759
- const [paletteExpanded, setPaletteExpanded] = useState4(false);
25760
- const [extrasExpanded, setExtrasExpanded] = useState4(false);
25837
+ const [paletteExpanded, setPaletteExpanded] = useState5(false);
25838
+ const [extrasExpanded, setExtrasExpanded] = useState5(false);
25761
25839
  const isDark = uiTheme === "dark";
25762
25840
  const { width: windowWidth } = useWindowDimensions3();
25763
25841
  const t = getStrings(locale);
@@ -25835,22 +25913,29 @@ var ToolDock = () => {
25835
25913
  const Icon = tool.icon;
25836
25914
  const visual = getToolVisual(tool.id);
25837
25915
  const baseIconColor = getToolAccentColor(tool, isDark);
25838
- return /* @__PURE__ */ jsx6(
25839
- Pressable3,
25916
+ const iconColor2 = resolveToolDockIconColor({
25917
+ toolId: tool.id,
25918
+ isSelected,
25919
+ annotationColor,
25920
+ accentColor,
25921
+ baseIconColor
25922
+ });
25923
+ return /* @__PURE__ */ jsx7(
25924
+ Pressable4,
25840
25925
  {
25841
25926
  onPress: () => {
25842
25927
  applyTool(tool.id);
25843
25928
  if (compact) setExtrasExpanded(false);
25844
25929
  },
25845
25930
  style: [
25846
- compact ? styles5.compactToolButton : styles5.toolButton,
25931
+ compact ? styles6.compactToolButton : styles6.toolButton,
25847
25932
  { width: compact ? void 0 : visual.width }
25848
25933
  ],
25849
- children: /* @__PURE__ */ jsx6(
25850
- View5,
25934
+ children: /* @__PURE__ */ jsx7(
25935
+ View6,
25851
25936
  {
25852
25937
  style: [
25853
- compact ? styles5.compactToolIconWrap : styles5.toolIconWrap,
25938
+ compact ? styles6.compactToolIconWrap : styles6.toolIconWrap,
25854
25939
  {
25855
25940
  transform: [
25856
25941
  { translateY: compact ? 4 : visual.offsetY },
@@ -25859,11 +25944,11 @@ var ToolDock = () => {
25859
25944
  opacity: isSelected ? 1 : 0.92
25860
25945
  }
25861
25946
  ],
25862
- children: /* @__PURE__ */ jsx6(
25947
+ children: /* @__PURE__ */ jsx7(
25863
25948
  Icon,
25864
25949
  {
25865
25950
  size: compact ? 34 : visual.iconSize,
25866
- color: isSelected ? accentColor : baseIconColor
25951
+ color: iconColor2
25867
25952
  }
25868
25953
  )
25869
25954
  }
@@ -25872,35 +25957,35 @@ var ToolDock = () => {
25872
25957
  tool.id
25873
25958
  );
25874
25959
  };
25875
- return /* @__PURE__ */ jsx6(View5, { pointerEvents: "box-none", style: styles5.root, children: toolDockOpen ? /* @__PURE__ */ jsxs6(View5, { style: styles5.stack, children: [
25876
- paletteExpanded ? /* @__PURE__ */ jsx6(
25877
- View5,
25960
+ return /* @__PURE__ */ jsx7(View6, { pointerEvents: "box-none", style: styles6.root, children: toolDockOpen ? /* @__PURE__ */ jsxs7(View6, { style: styles6.stack, children: [
25961
+ paletteExpanded ? /* @__PURE__ */ jsx7(
25962
+ View6,
25878
25963
  {
25879
25964
  style: [
25880
- styles5.popup,
25965
+ styles6.popup,
25881
25966
  {
25882
25967
  backgroundColor: panelColor,
25883
25968
  borderColor
25884
25969
  }
25885
25970
  ],
25886
- children: /* @__PURE__ */ jsx6(View5, { style: styles5.swatchRow, children: COLOR_SWATCHES.map((color) => {
25971
+ children: /* @__PURE__ */ jsx7(View6, { style: styles6.swatchRow, children: COLOR_SWATCHES.map((color) => {
25887
25972
  const isSelected = annotationColor === color;
25888
- return /* @__PURE__ */ jsx6(
25889
- Pressable3,
25973
+ return /* @__PURE__ */ jsx7(
25974
+ Pressable4,
25890
25975
  {
25891
25976
  onPress: () => setAnnotationColor(color),
25892
25977
  style: [
25893
- styles5.swatchOuter,
25978
+ styles6.swatchOuter,
25894
25979
  {
25895
25980
  borderColor: isSelected ? accentColor : "transparent",
25896
25981
  backgroundColor: isSelected ? `${accentColor}12` : "transparent"
25897
25982
  }
25898
25983
  ],
25899
- children: /* @__PURE__ */ jsx6(
25900
- View5,
25984
+ children: /* @__PURE__ */ jsx7(
25985
+ View6,
25901
25986
  {
25902
25987
  style: [
25903
- styles5.swatch,
25988
+ styles6.swatch,
25904
25989
  {
25905
25990
  backgroundColor: color,
25906
25991
  borderColor: color === "#f3f4f6" ? "#d1d5db" : "transparent"
@@ -25914,32 +25999,32 @@ var ToolDock = () => {
25914
25999
  }) })
25915
26000
  }
25916
26001
  ) : null,
25917
- inkSettingsExpanded ? /* @__PURE__ */ jsxs6(
25918
- View5,
26002
+ inkSettingsExpanded ? /* @__PURE__ */ jsxs7(
26003
+ View6,
25919
26004
  {
25920
26005
  style: [
25921
- styles5.popup,
25922
- styles5.inkPopup,
26006
+ styles6.popup,
26007
+ styles6.inkPopup,
25923
26008
  {
25924
26009
  backgroundColor: panelColor,
25925
26010
  borderColor
25926
26011
  }
25927
26012
  ],
25928
26013
  children: [
25929
- /* @__PURE__ */ jsx6(View5, { style: styles5.inkPreviewRow, children: INK_WIDTHS.map((width) => {
26014
+ /* @__PURE__ */ jsx7(View6, { style: styles6.inkPreviewRow, children: INK_WIDTHS.map((width) => {
25930
26015
  const selected = Math.abs(inkStrokeWidth - width) < 5e-4;
25931
- return /* @__PURE__ */ jsx6(
25932
- Pressable3,
26016
+ return /* @__PURE__ */ jsx7(
26017
+ Pressable4,
25933
26018
  {
25934
26019
  onPress: () => setInkStrokeWidth(width),
25935
26020
  style: [
25936
- styles5.inkWidthButton,
26021
+ styles6.inkWidthButton,
25937
26022
  selected && {
25938
26023
  backgroundColor: `${accentColor}12`,
25939
26024
  borderColor: `${accentColor}30`
25940
26025
  }
25941
26026
  ],
25942
- children: /* @__PURE__ */ jsx6(View5, { style: styles5.inkNib, children: /* @__PURE__ */ jsx6(
26027
+ children: /* @__PURE__ */ jsx7(View6, { style: styles6.inkNib, children: /* @__PURE__ */ jsx7(
25943
26028
  IconToolInk,
25944
26029
  {
25945
26030
  size: Math.round(18 + width * 1200),
@@ -25950,7 +26035,7 @@ var ToolDock = () => {
25950
26035
  width
25951
26036
  );
25952
26037
  }) }),
25953
- /* @__PURE__ */ jsx6(
26038
+ /* @__PURE__ */ jsx7(
25954
26039
  OpacitySlider,
25955
26040
  {
25956
26041
  value: annotationOpacity,
@@ -25962,106 +26047,106 @@ var ToolDock = () => {
25962
26047
  ]
25963
26048
  }
25964
26049
  ) : null,
25965
- extrasExpanded ? /* @__PURE__ */ jsx6(
25966
- View5,
26050
+ extrasExpanded ? /* @__PURE__ */ jsx7(
26051
+ View6,
25967
26052
  {
25968
26053
  style: [
25969
- styles5.popup,
25970
- styles5.extrasPopup,
26054
+ styles6.popup,
26055
+ styles6.extrasPopup,
25971
26056
  {
25972
26057
  backgroundColor: panelColor,
25973
26058
  borderColor
25974
26059
  }
25975
26060
  ],
25976
- children: /* @__PURE__ */ jsx6(View5, { style: styles5.compactToolsRow, children: EXTRA_TOOLS.map((tool) => renderToolButton(tool, true)) })
26061
+ children: /* @__PURE__ */ jsx7(View6, { style: styles6.compactToolsRow, children: EXTRA_TOOLS.map((tool) => renderToolButton(tool, true)) })
25977
26062
  }
25978
26063
  ) : null,
25979
- /* @__PURE__ */ jsx6(
25980
- View5,
26064
+ /* @__PURE__ */ jsx7(
26065
+ View6,
25981
26066
  {
25982
26067
  style: [
25983
- styles5.container,
26068
+ styles6.container,
25984
26069
  {
25985
26070
  backgroundColor: panelColor,
25986
26071
  borderColor
25987
26072
  }
25988
26073
  ],
25989
- children: primaryToolsRowIsScrollable ? /* @__PURE__ */ jsx6(
26074
+ children: primaryToolsRowIsScrollable ? /* @__PURE__ */ jsx7(
25990
26075
  ScrollView3,
25991
26076
  {
25992
26077
  horizontal: true,
25993
26078
  bounces: false,
25994
26079
  showsHorizontalScrollIndicator: false,
25995
- style: styles5.primaryToolsScrollView,
26080
+ style: styles6.primaryToolsScrollView,
25996
26081
  contentContainerStyle: [
25997
- styles5.primaryToolsRow,
25998
- styles5.primaryToolsRowScrollableContent
26082
+ styles6.primaryToolsRow,
26083
+ styles6.primaryToolsRowScrollableContent
25999
26084
  ],
26000
- children: /* @__PURE__ */ jsxs6(View5, { style: styles5.primaryToolsRowInner, children: [
26001
- /* @__PURE__ */ jsxs6(View5, { style: styles5.historyGroup, children: [
26002
- /* @__PURE__ */ jsx6(
26003
- Pressable3,
26085
+ children: /* @__PURE__ */ jsxs7(View6, { style: styles6.primaryToolsRowInner, children: [
26086
+ /* @__PURE__ */ jsxs7(View6, { style: styles6.historyGroup, children: [
26087
+ /* @__PURE__ */ jsx7(
26088
+ Pressable4,
26004
26089
  {
26005
26090
  onPress: undoAnnotations,
26006
26091
  disabled: !canUndo,
26007
26092
  style: [
26008
- styles5.utilityButton,
26009
- styles5.historyButton,
26093
+ styles6.utilityButton,
26094
+ styles6.historyButton,
26010
26095
  { backgroundColor: buttonColor },
26011
- !canUndo && styles5.disabledButton
26096
+ !canUndo && styles6.disabledButton
26012
26097
  ],
26013
- children: /* @__PURE__ */ jsx6(
26098
+ children: /* @__PURE__ */ jsx7(
26014
26099
  IconUndo,
26015
26100
  {
26016
- size: 16,
26017
- color: canUndo ? utilityIconColor : isDark ? "#4b5563" : "#9ca3af",
26101
+ size: MOBILE_CHROME_METRICS.toolDockHistoryIconSize,
26102
+ color: canUndo ? utilityIconColor : isDark ? MOBILE_CHROME_METRICS.toolDockDisabledIconColorDark : MOBILE_CHROME_METRICS.toolDockDisabledIconColorLight,
26018
26103
  strokeWidth: 2.2
26019
26104
  }
26020
26105
  )
26021
26106
  }
26022
26107
  ),
26023
- /* @__PURE__ */ jsx6(
26024
- Pressable3,
26108
+ /* @__PURE__ */ jsx7(
26109
+ Pressable4,
26025
26110
  {
26026
26111
  onPress: redoAnnotations,
26027
26112
  disabled: !canRedo,
26028
26113
  style: [
26029
- styles5.utilityButton,
26030
- styles5.historyButton,
26114
+ styles6.utilityButton,
26115
+ styles6.historyButton,
26031
26116
  { backgroundColor: buttonColor },
26032
- !canRedo && styles5.disabledButton
26117
+ !canRedo && styles6.disabledButton
26033
26118
  ],
26034
- children: /* @__PURE__ */ jsx6(
26119
+ children: /* @__PURE__ */ jsx7(
26035
26120
  IconRedo,
26036
26121
  {
26037
- size: 16,
26038
- color: canRedo ? utilityIconColor : isDark ? "#4b5563" : "#9ca3af",
26122
+ size: MOBILE_CHROME_METRICS.toolDockHistoryIconSize,
26123
+ color: canRedo ? utilityIconColor : isDark ? MOBILE_CHROME_METRICS.toolDockDisabledIconColorDark : MOBILE_CHROME_METRICS.toolDockDisabledIconColorLight,
26039
26124
  strokeWidth: 2.2
26040
26125
  }
26041
26126
  )
26042
26127
  }
26043
26128
  )
26044
26129
  ] }),
26045
- /* @__PURE__ */ jsx6(View5, { style: styles5.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
26046
- /* @__PURE__ */ jsxs6(View5, { style: styles5.controlsGroup, children: [
26047
- /* @__PURE__ */ jsx6(
26048
- Pressable3,
26130
+ /* @__PURE__ */ jsx7(View6, { style: styles6.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
26131
+ /* @__PURE__ */ jsxs7(View6, { style: styles6.controlsGroup, children: [
26132
+ /* @__PURE__ */ jsx7(
26133
+ Pressable4,
26049
26134
  {
26050
26135
  onPress: () => {
26051
26136
  setExtrasExpanded((value) => !value);
26052
26137
  setPaletteExpanded(false);
26053
26138
  },
26054
26139
  style: [
26055
- styles5.utilityButton,
26140
+ styles6.utilityButton,
26056
26141
  {
26057
26142
  backgroundColor: extrasExpanded ? `${accentColor}12` : buttonColor
26058
26143
  }
26059
26144
  ],
26060
- children: /* @__PURE__ */ jsx6(
26061
- Text2,
26145
+ children: /* @__PURE__ */ jsx7(
26146
+ Text3,
26062
26147
  {
26063
26148
  style: [
26064
- styles5.utilityLabel,
26149
+ styles6.utilityLabel,
26065
26150
  { color: extrasExpanded ? accentColor : utilityIconColor }
26066
26151
  ],
26067
26152
  children: "+"
@@ -26069,15 +26154,15 @@ var ToolDock = () => {
26069
26154
  )
26070
26155
  }
26071
26156
  ),
26072
- /* @__PURE__ */ jsx6(
26073
- Pressable3,
26157
+ /* @__PURE__ */ jsx7(
26158
+ Pressable4,
26074
26159
  {
26075
26160
  onPress: () => {
26076
26161
  setPaletteExpanded((value) => !value);
26077
26162
  setExtrasExpanded(false);
26078
26163
  },
26079
- style: styles5.colorButton,
26080
- children: /* @__PURE__ */ jsx6(
26164
+ style: styles6.colorButton,
26165
+ children: /* @__PURE__ */ jsx7(
26081
26166
  IconColorRing,
26082
26167
  {
26083
26168
  size: 30,
@@ -26087,8 +26172,8 @@ var ToolDock = () => {
26087
26172
  )
26088
26173
  }
26089
26174
  ),
26090
- /* @__PURE__ */ jsx6(
26091
- Pressable3,
26175
+ /* @__PURE__ */ jsx7(
26176
+ Pressable4,
26092
26177
  {
26093
26178
  onPress: () => setDocumentState(
26094
26179
  getToolDockDismissState({
@@ -26097,10 +26182,10 @@ var ToolDock = () => {
26097
26182
  })
26098
26183
  ),
26099
26184
  style: [
26100
- styles5.utilityButton,
26185
+ styles6.utilityButton,
26101
26186
  { backgroundColor: buttonColor }
26102
26187
  ],
26103
- children: /* @__PURE__ */ jsx6(
26188
+ children: /* @__PURE__ */ jsx7(
26104
26189
  IconClose,
26105
26190
  {
26106
26191
  size: 15,
@@ -26113,71 +26198,71 @@ var ToolDock = () => {
26113
26198
  ] })
26114
26199
  ] })
26115
26200
  }
26116
- ) : /* @__PURE__ */ jsxs6(View5, { style: styles5.primaryToolsRow, children: [
26117
- /* @__PURE__ */ jsxs6(View5, { style: styles5.historyGroup, children: [
26118
- /* @__PURE__ */ jsx6(
26119
- Pressable3,
26201
+ ) : /* @__PURE__ */ jsxs7(View6, { style: styles6.primaryToolsRow, children: [
26202
+ /* @__PURE__ */ jsxs7(View6, { style: styles6.historyGroup, children: [
26203
+ /* @__PURE__ */ jsx7(
26204
+ Pressable4,
26120
26205
  {
26121
26206
  onPress: undoAnnotations,
26122
26207
  disabled: !canUndo,
26123
26208
  style: [
26124
- styles5.utilityButton,
26125
- styles5.historyButton,
26209
+ styles6.utilityButton,
26210
+ styles6.historyButton,
26126
26211
  { backgroundColor: buttonColor },
26127
- !canUndo && styles5.disabledButton
26212
+ !canUndo && styles6.disabledButton
26128
26213
  ],
26129
- children: /* @__PURE__ */ jsx6(
26214
+ children: /* @__PURE__ */ jsx7(
26130
26215
  IconUndo,
26131
26216
  {
26132
- size: 16,
26133
- color: canUndo ? utilityIconColor : isDark ? "#4b5563" : "#9ca3af",
26217
+ size: MOBILE_CHROME_METRICS.toolDockHistoryIconSize,
26218
+ color: canUndo ? utilityIconColor : isDark ? MOBILE_CHROME_METRICS.toolDockDisabledIconColorDark : MOBILE_CHROME_METRICS.toolDockDisabledIconColorLight,
26134
26219
  strokeWidth: 2.2
26135
26220
  }
26136
26221
  )
26137
26222
  }
26138
26223
  ),
26139
- /* @__PURE__ */ jsx6(
26140
- Pressable3,
26224
+ /* @__PURE__ */ jsx7(
26225
+ Pressable4,
26141
26226
  {
26142
26227
  onPress: redoAnnotations,
26143
26228
  disabled: !canRedo,
26144
26229
  style: [
26145
- styles5.utilityButton,
26146
- styles5.historyButton,
26230
+ styles6.utilityButton,
26231
+ styles6.historyButton,
26147
26232
  { backgroundColor: buttonColor },
26148
- !canRedo && styles5.disabledButton
26233
+ !canRedo && styles6.disabledButton
26149
26234
  ],
26150
- children: /* @__PURE__ */ jsx6(
26235
+ children: /* @__PURE__ */ jsx7(
26151
26236
  IconRedo,
26152
26237
  {
26153
- size: 16,
26154
- color: canRedo ? utilityIconColor : isDark ? "#4b5563" : "#9ca3af",
26238
+ size: MOBILE_CHROME_METRICS.toolDockHistoryIconSize,
26239
+ color: canRedo ? utilityIconColor : isDark ? MOBILE_CHROME_METRICS.toolDockDisabledIconColorDark : MOBILE_CHROME_METRICS.toolDockDisabledIconColorLight,
26155
26240
  strokeWidth: 2.2
26156
26241
  }
26157
26242
  )
26158
26243
  }
26159
26244
  )
26160
26245
  ] }),
26161
- /* @__PURE__ */ jsx6(View5, { style: styles5.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
26162
- /* @__PURE__ */ jsxs6(View5, { style: styles5.controlsGroup, children: [
26163
- /* @__PURE__ */ jsx6(
26164
- Pressable3,
26246
+ /* @__PURE__ */ jsx7(View6, { style: styles6.toolsGroup, children: PRIMARY_TOOLS.map((tool) => renderToolButton(tool)) }),
26247
+ /* @__PURE__ */ jsxs7(View6, { style: styles6.controlsGroup, children: [
26248
+ /* @__PURE__ */ jsx7(
26249
+ Pressable4,
26165
26250
  {
26166
26251
  onPress: () => {
26167
26252
  setExtrasExpanded((value) => !value);
26168
26253
  setPaletteExpanded(false);
26169
26254
  },
26170
26255
  style: [
26171
- styles5.utilityButton,
26256
+ styles6.utilityButton,
26172
26257
  {
26173
26258
  backgroundColor: extrasExpanded ? `${accentColor}12` : buttonColor
26174
26259
  }
26175
26260
  ],
26176
- children: /* @__PURE__ */ jsx6(
26177
- Text2,
26261
+ children: /* @__PURE__ */ jsx7(
26262
+ Text3,
26178
26263
  {
26179
26264
  style: [
26180
- styles5.utilityLabel,
26265
+ styles6.utilityLabel,
26181
26266
  { color: extrasExpanded ? accentColor : utilityIconColor }
26182
26267
  ],
26183
26268
  children: "+"
@@ -26185,15 +26270,15 @@ var ToolDock = () => {
26185
26270
  )
26186
26271
  }
26187
26272
  ),
26188
- /* @__PURE__ */ jsx6(
26189
- Pressable3,
26273
+ /* @__PURE__ */ jsx7(
26274
+ Pressable4,
26190
26275
  {
26191
26276
  onPress: () => {
26192
26277
  setPaletteExpanded((value) => !value);
26193
26278
  setExtrasExpanded(false);
26194
26279
  },
26195
- style: styles5.colorButton,
26196
- children: /* @__PURE__ */ jsx6(
26280
+ style: styles6.colorButton,
26281
+ children: /* @__PURE__ */ jsx7(
26197
26282
  IconColorRing,
26198
26283
  {
26199
26284
  size: 30,
@@ -26203,8 +26288,8 @@ var ToolDock = () => {
26203
26288
  )
26204
26289
  }
26205
26290
  ),
26206
- /* @__PURE__ */ jsx6(
26207
- Pressable3,
26291
+ /* @__PURE__ */ jsx7(
26292
+ Pressable4,
26208
26293
  {
26209
26294
  onPress: () => setDocumentState(
26210
26295
  getToolDockDismissState({
@@ -26212,8 +26297,8 @@ var ToolDock = () => {
26212
26297
  interactionMode
26213
26298
  })
26214
26299
  ),
26215
- style: [styles5.utilityButton, { backgroundColor: buttonColor }],
26216
- children: /* @__PURE__ */ jsx6(
26300
+ style: [styles6.utilityButton, { backgroundColor: buttonColor }],
26301
+ children: /* @__PURE__ */ jsx7(
26217
26302
  IconClose,
26218
26303
  {
26219
26304
  size: 15,
@@ -26229,17 +26314,17 @@ var ToolDock = () => {
26229
26314
  )
26230
26315
  ] }) : null });
26231
26316
  };
26232
- var styles5 = StyleSheet5.create({
26317
+ var styles6 = StyleSheet6.create({
26233
26318
  root: {
26234
- ...StyleSheet5.absoluteFillObject,
26319
+ ...StyleSheet6.absoluteFillObject,
26235
26320
  alignItems: "center",
26236
26321
  justifyContent: "flex-end",
26237
- paddingHorizontal: 0,
26322
+ paddingHorizontal: MOBILE_CHROME_METRICS.screenPadding,
26238
26323
  paddingBottom: 72
26239
26324
  },
26240
26325
  stack: {
26241
26326
  width: "100%",
26242
- maxWidth: 520,
26327
+ maxWidth: MOBILE_CHROME_METRICS.maxToolDockWidth,
26243
26328
  alignItems: "center"
26244
26329
  },
26245
26330
  container: {
@@ -26249,7 +26334,7 @@ var styles5 = StyleSheet5.create({
26249
26334
  borderWidth: 1,
26250
26335
  paddingLeft: 12,
26251
26336
  paddingRight: 12,
26252
- paddingTop: 8,
26337
+ paddingTop: MOBILE_CHROME_METRICS.toolDockPaddingTop,
26253
26338
  paddingBottom: 2,
26254
26339
  justifyContent: "center",
26255
26340
  overflow: "hidden",
@@ -26302,7 +26387,7 @@ var styles5 = StyleSheet5.create({
26302
26387
  historyGroup: {
26303
26388
  flexDirection: "row",
26304
26389
  alignItems: "center",
26305
- gap: 6,
26390
+ gap: MOBILE_CHROME_METRICS.toolDockHistoryGap,
26306
26391
  width: 82,
26307
26392
  height: 52
26308
26393
  },
@@ -26427,7 +26512,7 @@ var styles5 = StyleSheet5.create({
26427
26512
  },
26428
26513
  historyButton: {},
26429
26514
  disabledButton: {
26430
- opacity: 0.45
26515
+ opacity: MOBILE_CHROME_METRICS.toolDockDisabledOpacity
26431
26516
  },
26432
26517
  utilityLabel: {
26433
26518
  fontSize: 28,
@@ -26473,23 +26558,33 @@ var withInkAlpha = (hex, alpha) => {
26473
26558
  var ToolDock_default = ToolDock;
26474
26559
 
26475
26560
  // components/RightSheet.tsx
26476
- import { useCallback as useCallback3, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef5, useState as useState5 } from "react";
26561
+ import { useCallback as useCallback3, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef5, useState as useState6 } from "react";
26477
26562
  import {
26478
26563
  Dimensions,
26479
- FlatList as FlatList2,
26480
- Modal as Modal2,
26481
26564
  Platform as Platform2,
26482
- Pressable as Pressable4,
26483
- ScrollView as ScrollView4,
26484
- StyleSheet as StyleSheet6,
26485
- Text as Text3,
26565
+ Pressable as Pressable5,
26566
+ StyleSheet as StyleSheet7,
26567
+ Text as Text4,
26486
26568
  UIManager,
26487
- View as View6,
26569
+ View as View7,
26488
26570
  findNodeHandle as findNodeHandle2
26489
26571
  } from "react-native";
26572
+ import BottomSheet, {
26573
+ BottomSheetBackdrop,
26574
+ BottomSheetFlatList,
26575
+ BottomSheetScrollView
26576
+ } from "@gorhom/bottom-sheet";
26490
26577
  import { useViewerStore as useViewerStore6 } from "@papyrus-sdk/core";
26491
26578
  import { PapyrusPageView as PapyrusPageView2 } from "@papyrus-sdk/engine-native";
26492
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
26579
+
26580
+ // components/rightSheetLayout.ts
26581
+ var resolveRightSheetHeight = ({
26582
+ windowHeight,
26583
+ showingNotes
26584
+ }) => showingNotes ? Math.min(440, windowHeight * 0.56) : Math.min(640, windowHeight * 0.72);
26585
+
26586
+ // components/RightSheet.tsx
26587
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
26493
26588
  var THUMBNAILS_INITIAL_NUM_TO_RENDER = 4;
26494
26589
  var THUMBNAILS_WINDOW_SIZE = 5;
26495
26590
  var THUMBNAILS_MAX_TO_RENDER_PER_BATCH = 6;
@@ -26523,7 +26618,7 @@ var PageThumbnail = ({
26523
26618
  onPress
26524
26619
  }) => {
26525
26620
  const viewRef = useRef5(null);
26526
- const [layoutReady, setLayoutReady] = useState5(false);
26621
+ const [layoutReady, setLayoutReady] = useState6(false);
26527
26622
  useEffect6(() => {
26528
26623
  if (!layoutReady || !useNativePreview || !shouldRenderPreview) return;
26529
26624
  const viewTag = findNodeHandle2(viewRef.current);
@@ -26544,36 +26639,36 @@ var PageThumbnail = ({
26544
26639
  setLayoutReady(true);
26545
26640
  }
26546
26641
  };
26547
- return /* @__PURE__ */ jsxs7(
26548
- Pressable4,
26642
+ return /* @__PURE__ */ jsxs8(
26643
+ Pressable5,
26549
26644
  {
26550
26645
  onPress,
26551
26646
  style: [
26552
- styles6.thumbCard,
26647
+ styles7.thumbCard,
26553
26648
  { width: cardWidth },
26554
- isDark && styles6.thumbCardDark,
26555
- isActive && styles6.thumbCardActive,
26649
+ isDark && styles7.thumbCardDark,
26650
+ isActive && styles7.thumbCardActive,
26556
26651
  isActive && { borderColor: accentColor }
26557
26652
  ],
26558
26653
  children: [
26559
- /* @__PURE__ */ jsx7(
26560
- View6,
26654
+ /* @__PURE__ */ jsx8(
26655
+ View7,
26561
26656
  {
26562
26657
  onLayout: handleLayout,
26563
- style: [styles6.thumbFrame, { width: frameWidth, height: frameHeight }],
26564
- children: useNativePreview && shouldRenderPreview ? /* @__PURE__ */ jsx7(PapyrusPageView2, { ref: viewRef, style: styles6.thumbView }) : /* @__PURE__ */ jsx7(View6, { style: [styles6.thumbFallback, isDark && styles6.thumbFallbackDark], children: /* @__PURE__ */ jsx7(
26565
- Text3,
26658
+ style: [styles7.thumbFrame, { width: frameWidth, height: frameHeight }],
26659
+ children: useNativePreview && shouldRenderPreview ? /* @__PURE__ */ jsx8(PapyrusPageView2, { ref: viewRef, style: styles7.thumbView }) : /* @__PURE__ */ jsx8(View7, { style: [styles7.thumbFallback, isDark && styles7.thumbFallbackDark], children: /* @__PURE__ */ jsx8(
26660
+ Text4,
26566
26661
  {
26567
26662
  style: [
26568
- styles6.thumbFallbackText,
26569
- isDark && styles6.thumbFallbackTextDark
26663
+ styles7.thumbFallbackText,
26664
+ isDark && styles7.thumbFallbackTextDark
26570
26665
  ],
26571
26666
  children: pageIndex + 1
26572
26667
  }
26573
26668
  ) })
26574
26669
  }
26575
26670
  ),
26576
- /* @__PURE__ */ jsx7(Text3, { style: [styles6.thumbLabel, isDark && styles6.thumbLabelDark], children: pageIndex + 1 })
26671
+ /* @__PURE__ */ jsx8(Text4, { style: [styles7.thumbLabel, isDark && styles7.thumbLabelDark], children: pageIndex + 1 })
26577
26672
  ]
26578
26673
  }
26579
26674
  );
@@ -26581,21 +26676,21 @@ var PageThumbnail = ({
26581
26676
  var OutlineNode = ({ item, depth = 0, isDark, onSelect, untitledLabel }) => {
26582
26677
  const hasChildren = item.children && item.children.length > 0;
26583
26678
  const isClickable = item.pageIndex >= 0;
26584
- return /* @__PURE__ */ jsxs7(View6, { children: [
26585
- /* @__PURE__ */ jsx7(
26586
- Pressable4,
26679
+ return /* @__PURE__ */ jsxs8(View7, { children: [
26680
+ /* @__PURE__ */ jsx8(
26681
+ Pressable5,
26587
26682
  {
26588
26683
  onPress: () => {
26589
26684
  if (isClickable) onSelect(item.pageIndex);
26590
26685
  },
26591
- style: [styles6.outlineRow, { paddingLeft: 12 + depth * 12 }],
26592
- children: /* @__PURE__ */ jsx7(
26593
- Text3,
26686
+ style: [styles7.outlineRow, { paddingLeft: 12 + depth * 12 }],
26687
+ children: /* @__PURE__ */ jsx8(
26688
+ Text4,
26594
26689
  {
26595
26690
  style: [
26596
- styles6.outlineText,
26597
- isDark && styles6.outlineTextDark,
26598
- !isClickable && styles6.outlineTextMuted
26691
+ styles7.outlineText,
26692
+ isDark && styles7.outlineTextDark,
26693
+ !isClickable && styles7.outlineTextMuted
26599
26694
  ],
26600
26695
  numberOfLines: 2,
26601
26696
  children: item.title || untitledLabel
@@ -26603,7 +26698,7 @@ var OutlineNode = ({ item, depth = 0, isDark, onSelect, untitledLabel }) => {
26603
26698
  )
26604
26699
  }
26605
26700
  ),
26606
- hasChildren ? item.children.map((child, index) => /* @__PURE__ */ jsx7(
26701
+ hasChildren ? item.children.map((child, index) => /* @__PURE__ */ jsx8(
26607
26702
  OutlineNode,
26608
26703
  {
26609
26704
  item: child,
@@ -26619,7 +26714,8 @@ var OutlineNode = ({ item, depth = 0, isDark, onSelect, untitledLabel }) => {
26619
26714
  var RightSheet = ({
26620
26715
  engine,
26621
26716
  documentType,
26622
- thumbsInitialCount
26717
+ thumbsInitialCount,
26718
+ onOpenPageJump
26623
26719
  }) => {
26624
26720
  const {
26625
26721
  activeMobileDestination,
@@ -26637,12 +26733,17 @@ var RightSheet = ({
26637
26733
  locale,
26638
26734
  accentColor
26639
26735
  } = useViewerStore6();
26640
- const [pagesMode, setPagesMode] = useState5(
26736
+ const [pagesMode, setPagesMode] = useState6(
26641
26737
  documentType === "pdf" ? "thumbnails" : "summary"
26642
26738
  );
26643
26739
  const isDark = uiTheme === "dark";
26644
26740
  const t = getStrings(locale);
26645
- const sheetHeight = Math.min(640, Dimensions.get("window").height * 0.72);
26741
+ const showingNotes = sidebarRightTab === "annotations";
26742
+ const sheetHeight = resolveRightSheetHeight({
26743
+ windowHeight: Dimensions.get("window").height,
26744
+ showingNotes
26745
+ });
26746
+ const snapPoints = useMemo5(() => [sheetHeight], [sheetHeight]);
26646
26747
  const windowWidth = Dimensions.get("window").width;
26647
26748
  const gridGutter = 12;
26648
26749
  const gridPadding = 16;
@@ -26656,8 +26757,8 @@ var RightSheet = ({
26656
26757
  const thumbnailDimensionsCacheRef = useRef5(/* @__PURE__ */ new Map());
26657
26758
  const thumbnailDimensionsPendingRef = useRef5(/* @__PURE__ */ new Set());
26658
26759
  const thumbnailRefreshTimeoutRef = useRef5(null);
26659
- const [thumbnailLayoutRevision, setThumbnailLayoutRevision] = useState5(0);
26660
- const [visibleThumbnailPages, setVisibleThumbnailPages] = useState5(
26760
+ const [thumbnailLayoutRevision, setThumbnailLayoutRevision] = useState6(0);
26761
+ const [visibleThumbnailPages, setVisibleThumbnailPages] = useState6(
26661
26762
  () => /* @__PURE__ */ new Set()
26662
26763
  );
26663
26764
  const resolvedThumbsInitialCount = useMemo5(
@@ -26674,7 +26775,6 @@ var RightSheet = ({
26674
26775
  resolvedThumbsInitialCount,
26675
26776
  resolvedThumbsPrewarmCount
26676
26777
  );
26677
- const showingNotes = sidebarRightTab === "annotations";
26678
26778
  const showingProgress = documentType === "text" || activeMobileDestination === "progress";
26679
26779
  const supportsThumbnails = documentType !== "text";
26680
26780
  const navigationTitle = showingProgress ? t.progress : documentType === "epub" || activeMobileDestination === "contents" ? t.contents : t.pages;
@@ -26811,7 +26911,7 @@ var RightSheet = ({
26811
26911
  const renderThumbnailItem = useCallback3(
26812
26912
  ({ item }) => {
26813
26913
  const shouldRenderPreview = useNativePreview && (visibleThumbnailPages.has(item) || item < resolvedThumbsPrewarmCount || Math.abs(item + 1 - currentPage) <= 1);
26814
- return /* @__PURE__ */ jsx7(
26914
+ return /* @__PURE__ */ jsx8(
26815
26915
  PageThumbnail,
26816
26916
  {
26817
26917
  engine,
@@ -26844,267 +26944,275 @@ var RightSheet = ({
26844
26944
  zoom
26845
26945
  ]
26846
26946
  );
26947
+ const renderBackdrop = useCallback3(
26948
+ (props) => /* @__PURE__ */ jsx8(
26949
+ BottomSheetBackdrop,
26950
+ {
26951
+ ...props,
26952
+ appearsOnIndex: 0,
26953
+ disappearsOnIndex: -1,
26954
+ opacity: 0.4,
26955
+ pressBehavior: "close"
26956
+ }
26957
+ ),
26958
+ []
26959
+ );
26847
26960
  if (!sidebarRightOpen) return null;
26848
- return /* @__PURE__ */ jsx7(
26849
- Modal2,
26961
+ return /* @__PURE__ */ jsx8(View7, { style: styles7.modalRoot, pointerEvents: "box-none", children: /* @__PURE__ */ jsx8(
26962
+ BottomSheet,
26850
26963
  {
26851
- visible: true,
26852
- transparent: true,
26853
- animationType: "slide",
26854
- onRequestClose: closeSheet,
26855
- children: /* @__PURE__ */ jsxs7(View6, { style: styles6.modalRoot, children: [
26856
- /* @__PURE__ */ jsx7(Pressable4, { style: styles6.backdrop, onPress: closeSheet }),
26857
- /* @__PURE__ */ jsxs7(
26858
- View6,
26859
- {
26860
- style: [
26861
- styles6.sheet,
26862
- { height: sheetHeight },
26863
- isDark && styles6.sheetDark
26864
- ],
26865
- children: [
26866
- /* @__PURE__ */ jsx7(View6, { style: [styles6.handle, isDark && styles6.handleDark] }),
26867
- /* @__PURE__ */ jsxs7(View6, { style: styles6.header, children: [
26868
- /* @__PURE__ */ jsx7(Text3, { style: [styles6.sheetTitle, isDark && styles6.sheetTitleDark], children: showingNotes ? t.notes : navigationTitle }),
26869
- !showingNotes ? /* @__PURE__ */ jsx7(Text3, { style: [styles6.pageStatus, isDark && styles6.pageStatusDark], children: showingProgress ? `${Math.round(currentPage / Math.max(pageCount, 1) * 100)}%` : `${t.page} ${currentPage} / ${pageCount}` }) : null
26870
- ] }),
26871
- !showingNotes ? /* @__PURE__ */ jsxs7(View6, { style: styles6.pagesContent, children: [
26872
- !showingProgress ? /* @__PURE__ */ jsx7(View6, { style: styles6.pageHeader, children: /* @__PURE__ */ jsxs7(View6, { style: [styles6.segmented, isDark && styles6.segmentedDark], children: [
26873
- supportsThumbnails ? /* @__PURE__ */ jsx7(
26874
- Pressable4,
26875
- {
26876
- onPress: () => setPagesMode("thumbnails"),
26877
- style: [
26878
- styles6.segmentButton,
26879
- pagesMode === "thumbnails" && styles6.segmentButtonActive,
26880
- pagesMode === "thumbnails" && {
26881
- backgroundColor: accentColor
26882
- }
26883
- ],
26884
- children: /* @__PURE__ */ jsx7(
26885
- Text3,
26886
- {
26887
- style: [
26888
- styles6.segmentText,
26889
- isDark && styles6.segmentTextDark,
26890
- pagesMode === "thumbnails" && styles6.segmentTextActive
26891
- ],
26892
- children: thumbnailLabel
26893
- }
26894
- )
26895
- }
26896
- ) : null,
26897
- /* @__PURE__ */ jsx7(
26898
- Pressable4,
26899
- {
26900
- onPress: () => setPagesMode("summary"),
26901
- style: [
26902
- styles6.segmentButton,
26903
- pagesMode === "summary" && styles6.segmentButtonActive,
26904
- pagesMode === "summary" && {
26905
- backgroundColor: accentColor
26906
- }
26907
- ],
26908
- children: /* @__PURE__ */ jsx7(
26909
- Text3,
26964
+ index: 0,
26965
+ snapPoints,
26966
+ enablePanDownToClose: true,
26967
+ onClose: closeSheet,
26968
+ backdropComponent: renderBackdrop,
26969
+ backgroundStyle: [styles7.sheetBackground, isDark && styles7.sheetDark],
26970
+ handleIndicatorStyle: [styles7.handle, isDark && styles7.handleDark],
26971
+ handleStyle: styles7.handleContainer,
26972
+ children: /* @__PURE__ */ jsxs8(View7, { style: styles7.sheet, children: [
26973
+ /* @__PURE__ */ jsxs8(View7, { style: styles7.header, children: [
26974
+ /* @__PURE__ */ jsx8(Text4, { style: [styles7.sheetTitle, isDark && styles7.sheetTitleDark], children: showingNotes ? t.notes : navigationTitle }),
26975
+ !showingNotes ? /* @__PURE__ */ jsx8(
26976
+ Pressable5,
26977
+ {
26978
+ onPress: showingProgress ? void 0 : onOpenPageJump,
26979
+ disabled: showingProgress || pageCount <= 0,
26980
+ style: styles7.pageStatusHit,
26981
+ accessibilityLabel: "Open page jump",
26982
+ children: /* @__PURE__ */ jsx8(Text4, { style: [styles7.pageStatus, isDark && styles7.pageStatusDark], children: showingProgress ? `${Math.round(currentPage / Math.max(pageCount, 1) * 100)}%` : `${currentPage}/${pageCount}` })
26983
+ }
26984
+ ) : null
26985
+ ] }),
26986
+ !showingNotes ? /* @__PURE__ */ jsxs8(View7, { style: styles7.pagesContent, children: [
26987
+ !showingProgress ? /* @__PURE__ */ jsx8(View7, { style: styles7.pageHeader, children: /* @__PURE__ */ jsxs8(View7, { style: [styles7.segmented, isDark && styles7.segmentedDark], children: [
26988
+ supportsThumbnails ? /* @__PURE__ */ jsx8(
26989
+ Pressable5,
26990
+ {
26991
+ onPress: () => setPagesMode("thumbnails"),
26992
+ style: [
26993
+ styles7.segmentButton,
26994
+ pagesMode === "thumbnails" && styles7.segmentButtonActive,
26995
+ pagesMode === "thumbnails" && {
26996
+ backgroundColor: accentColor
26997
+ }
26998
+ ],
26999
+ children: /* @__PURE__ */ jsx8(
27000
+ Text4,
27001
+ {
27002
+ style: [
27003
+ styles7.segmentText,
27004
+ isDark && styles7.segmentTextDark,
27005
+ pagesMode === "thumbnails" && styles7.segmentTextActive
27006
+ ],
27007
+ children: thumbnailLabel
27008
+ }
27009
+ )
27010
+ }
27011
+ ) : null,
27012
+ /* @__PURE__ */ jsx8(
27013
+ Pressable5,
27014
+ {
27015
+ onPress: () => setPagesMode("summary"),
27016
+ style: [
27017
+ styles7.segmentButton,
27018
+ pagesMode === "summary" && styles7.segmentButtonActive,
27019
+ pagesMode === "summary" && {
27020
+ backgroundColor: accentColor
27021
+ }
27022
+ ],
27023
+ children: /* @__PURE__ */ jsx8(
27024
+ Text4,
27025
+ {
27026
+ style: [
27027
+ styles7.segmentText,
27028
+ isDark && styles7.segmentTextDark,
27029
+ pagesMode === "summary" && styles7.segmentTextActive
27030
+ ],
27031
+ children: summaryLabel
27032
+ }
27033
+ )
27034
+ }
27035
+ )
27036
+ ] }) }) : null,
27037
+ supportsThumbnails && !showingProgress && pagesMode === "thumbnails" ? /* @__PURE__ */ jsx8(
27038
+ BottomSheetFlatList,
27039
+ {
27040
+ data: pages,
27041
+ keyExtractor: (item) => `thumb-${item}`,
27042
+ numColumns: 2,
27043
+ contentContainerStyle: styles7.thumbGrid,
27044
+ columnWrapperStyle: styles7.thumbRow,
27045
+ showsVerticalScrollIndicator: false,
27046
+ initialNumToRender: normalizedThumbsInitialCount,
27047
+ windowSize: THUMBNAILS_WINDOW_SIZE,
27048
+ maxToRenderPerBatch: THUMBNAILS_MAX_TO_RENDER_PER_BATCH,
27049
+ updateCellsBatchingPeriod: THUMBNAILS_UPDATE_CELLS_BATCHING_PERIOD,
27050
+ removeClippedSubviews: true,
27051
+ viewabilityConfig: { itemVisiblePercentThreshold: 20 },
27052
+ onViewableItemsChanged: onThumbnailsViewableItemsChanged,
27053
+ renderItem: renderThumbnailItem
27054
+ }
27055
+ ) : showingProgress ? /* @__PURE__ */ jsx8(
27056
+ BottomSheetScrollView,
27057
+ {
27058
+ contentContainerStyle: styles7.summaryContent,
27059
+ showsVerticalScrollIndicator: false,
27060
+ children: progressEntries.map((entry) => {
27061
+ const isActive = entry.pageIndex + 1 === currentPage;
27062
+ return /* @__PURE__ */ jsxs8(
27063
+ Pressable5,
27064
+ {
27065
+ onPress: () => jumpToPage(entry.pageIndex),
27066
+ style: [
27067
+ styles7.progressRow,
27068
+ isDark && styles7.progressRowDark,
27069
+ isActive && { borderColor: accentColor }
27070
+ ],
27071
+ children: [
27072
+ /* @__PURE__ */ jsxs8(
27073
+ Text4,
26910
27074
  {
26911
27075
  style: [
26912
- styles6.segmentText,
26913
- isDark && styles6.segmentTextDark,
26914
- pagesMode === "summary" && styles6.segmentTextActive
27076
+ styles7.progressLabel,
27077
+ isDark && styles7.progressLabelDark
26915
27078
  ],
26916
- children: summaryLabel
27079
+ children: [
27080
+ entry.percent,
27081
+ "%"
27082
+ ]
26917
27083
  }
26918
- )
26919
- }
26920
- )
26921
- ] }) }) : null,
26922
- supportsThumbnails && !showingProgress && pagesMode === "thumbnails" ? /* @__PURE__ */ jsx7(
26923
- FlatList2,
26924
- {
26925
- data: pages,
26926
- keyExtractor: (item) => `thumb-${item}`,
26927
- numColumns: 2,
26928
- contentContainerStyle: styles6.thumbGrid,
26929
- columnWrapperStyle: styles6.thumbRow,
26930
- showsVerticalScrollIndicator: false,
26931
- initialNumToRender: normalizedThumbsInitialCount,
26932
- windowSize: THUMBNAILS_WINDOW_SIZE,
26933
- maxToRenderPerBatch: THUMBNAILS_MAX_TO_RENDER_PER_BATCH,
26934
- updateCellsBatchingPeriod: THUMBNAILS_UPDATE_CELLS_BATCHING_PERIOD,
26935
- removeClippedSubviews: true,
26936
- viewabilityConfig: { itemVisiblePercentThreshold: 20 },
26937
- onViewableItemsChanged: onThumbnailsViewableItemsChanged,
26938
- renderItem: renderThumbnailItem
26939
- }
26940
- ) : showingProgress ? /* @__PURE__ */ jsx7(
26941
- ScrollView4,
26942
- {
26943
- contentContainerStyle: styles6.summaryContent,
26944
- showsVerticalScrollIndicator: false,
26945
- children: progressEntries.map((entry) => {
26946
- const isActive = entry.pageIndex + 1 === currentPage;
26947
- return /* @__PURE__ */ jsxs7(
26948
- Pressable4,
27084
+ ),
27085
+ /* @__PURE__ */ jsxs8(
27086
+ Text4,
26949
27087
  {
26950
- onPress: () => jumpToPage(entry.pageIndex),
26951
27088
  style: [
26952
- styles6.progressRow,
26953
- isDark && styles6.progressRowDark,
26954
- isActive && { borderColor: accentColor }
27089
+ styles7.progressMeta,
27090
+ isDark && styles7.progressMetaDark
26955
27091
  ],
26956
27092
  children: [
26957
- /* @__PURE__ */ jsxs7(
26958
- Text3,
26959
- {
26960
- style: [
26961
- styles6.progressLabel,
26962
- isDark && styles6.progressLabelDark
26963
- ],
26964
- children: [
26965
- entry.percent,
26966
- "%"
26967
- ]
26968
- }
26969
- ),
26970
- /* @__PURE__ */ jsxs7(
26971
- Text3,
26972
- {
26973
- style: [
26974
- styles6.progressMeta,
26975
- isDark && styles6.progressMetaDark
26976
- ],
26977
- children: [
26978
- t.page,
26979
- " ",
26980
- entry.pageIndex + 1
26981
- ]
26982
- }
26983
- )
27093
+ t.page,
27094
+ " ",
27095
+ entry.pageIndex + 1
26984
27096
  ]
26985
- },
26986
- `progress-${entry.pageIndex}`
26987
- );
26988
- })
26989
- }
26990
- ) : /* @__PURE__ */ jsx7(
26991
- ScrollView4,
26992
- {
26993
- contentContainerStyle: styles6.summaryContent,
26994
- showsVerticalScrollIndicator: false,
26995
- children: outline.length === 0 ? /* @__PURE__ */ jsx7(Text3, { style: [styles6.emptyText, isDark && styles6.emptyTextDark], children: t.noSummary }) : outline.map((item, index) => /* @__PURE__ */ jsx7(
26996
- OutlineNode,
26997
- {
26998
- item,
26999
- isDark,
27000
- untitledLabel: t.untitled,
27001
- onSelect: jumpToPage
27002
- },
27003
- `${item.title}-${index}`
27004
- ))
27005
- }
27006
- )
27007
- ] }) : /* @__PURE__ */ jsx7(
27008
- ScrollView4,
27097
+ }
27098
+ )
27099
+ ]
27100
+ },
27101
+ `progress-${entry.pageIndex}`
27102
+ );
27103
+ })
27104
+ }
27105
+ ) : /* @__PURE__ */ jsx8(
27106
+ BottomSheetScrollView,
27107
+ {
27108
+ contentContainerStyle: styles7.summaryContent,
27109
+ showsVerticalScrollIndicator: false,
27110
+ children: outline.length === 0 ? /* @__PURE__ */ jsx8(Text4, { style: [styles7.emptyText, isDark && styles7.emptyTextDark], children: t.noSummary }) : outline.map((item, index) => /* @__PURE__ */ jsx8(
27111
+ OutlineNode,
27009
27112
  {
27010
- contentContainerStyle: styles6.content,
27011
- showsVerticalScrollIndicator: false,
27012
- children: annotations.length === 0 ? /* @__PURE__ */ jsx7(Text3, { style: [styles6.emptyText, isDark && styles6.emptyTextDark], children: t.noAnnotations }) : /* @__PURE__ */ jsx7(View6, { children: annotations.map((ann) => /* @__PURE__ */ jsxs7(
27013
- Pressable4,
27113
+ item,
27114
+ isDark,
27115
+ untitledLabel: t.untitled,
27116
+ onSelect: jumpToPage
27117
+ },
27118
+ `${item.title}-${index}`
27119
+ ))
27120
+ }
27121
+ )
27122
+ ] }) : /* @__PURE__ */ jsx8(
27123
+ BottomSheetScrollView,
27124
+ {
27125
+ contentContainerStyle: styles7.content,
27126
+ showsVerticalScrollIndicator: false,
27127
+ children: annotations.length === 0 ? /* @__PURE__ */ jsx8(Text4, { style: [styles7.emptyText, isDark && styles7.emptyTextDark], children: t.noAnnotations }) : /* @__PURE__ */ jsx8(View7, { children: annotations.map((ann) => /* @__PURE__ */ jsxs8(
27128
+ Pressable5,
27129
+ {
27130
+ onPress: () => {
27131
+ setSelectedAnnotation(ann.id);
27132
+ triggerScrollToPage(ann.pageIndex);
27133
+ closeSheet();
27134
+ },
27135
+ style: [styles7.noteCard, isDark && styles7.noteCardDark],
27136
+ children: [
27137
+ /* @__PURE__ */ jsxs8(View7, { style: styles7.noteHeader, children: [
27138
+ /* @__PURE__ */ jsx8(
27139
+ View7,
27140
+ {
27141
+ style: [styles7.noteDot, { backgroundColor: ann.color }]
27142
+ }
27143
+ ),
27144
+ /* @__PURE__ */ jsxs8(
27145
+ Text4,
27146
+ {
27147
+ style: [styles7.noteTitle, isDark && styles7.noteTitleDark],
27148
+ children: [
27149
+ t.page,
27150
+ " ",
27151
+ ann.pageIndex + 1
27152
+ ]
27153
+ }
27154
+ )
27155
+ ] }),
27156
+ /* @__PURE__ */ jsx8(
27157
+ Text4,
27014
27158
  {
27015
- onPress: () => {
27016
- setSelectedAnnotation(ann.id);
27017
- triggerScrollToPage(ann.pageIndex);
27018
- closeSheet();
27019
- },
27020
- style: [styles6.noteCard, isDark && styles6.noteCardDark],
27021
- children: [
27022
- /* @__PURE__ */ jsxs7(View6, { style: styles6.noteHeader, children: [
27023
- /* @__PURE__ */ jsx7(
27024
- View6,
27025
- {
27026
- style: [styles6.noteDot, { backgroundColor: ann.color }]
27027
- }
27028
- ),
27029
- /* @__PURE__ */ jsxs7(
27030
- Text3,
27031
- {
27032
- style: [styles6.noteTitle, isDark && styles6.noteTitleDark],
27033
- children: [
27034
- t.page,
27035
- " ",
27036
- ann.pageIndex + 1
27037
- ]
27038
- }
27039
- )
27040
- ] }),
27041
- /* @__PURE__ */ jsx7(
27042
- Text3,
27043
- {
27044
- style: [
27045
- styles6.noteType,
27046
- isDark && styles6.noteTypeDark,
27047
- { color: accentColor }
27048
- ],
27049
- children: ann.type === "comment" || ann.type === "text" ? t.note.toUpperCase() : ann.type.toUpperCase()
27050
- }
27051
- ),
27052
- ann.content ? /* @__PURE__ */ jsx7(
27053
- Text3,
27054
- {
27055
- style: [
27056
- styles6.noteContent,
27057
- isDark && styles6.noteContentDark
27058
- ],
27059
- children: ann.content
27060
- }
27061
- ) : null
27062
- ]
27063
- },
27064
- ann.id
27065
- )) })
27066
- }
27067
- )
27068
- ]
27159
+ style: [
27160
+ styles7.noteType,
27161
+ isDark && styles7.noteTypeDark,
27162
+ { color: accentColor }
27163
+ ],
27164
+ children: ann.type === "comment" || ann.type === "text" ? t.note.toUpperCase() : ann.type.toUpperCase()
27165
+ }
27166
+ ),
27167
+ ann.content ? /* @__PURE__ */ jsx8(
27168
+ Text4,
27169
+ {
27170
+ style: [
27171
+ styles7.noteContent,
27172
+ isDark && styles7.noteContentDark
27173
+ ],
27174
+ children: ann.content
27175
+ }
27176
+ ) : null
27177
+ ]
27178
+ },
27179
+ ann.id
27180
+ )) })
27069
27181
  }
27070
27182
  )
27071
27183
  ] })
27072
27184
  }
27073
- );
27185
+ ) });
27074
27186
  };
27075
- var styles6 = StyleSheet6.create({
27187
+ var styles7 = StyleSheet7.create({
27076
27188
  modalRoot: {
27077
- flex: 1,
27078
- backgroundColor: "transparent"
27079
- },
27080
- backdrop: {
27081
- ...StyleSheet6.absoluteFillObject,
27082
- backgroundColor: "rgba(0, 0, 0, 0.4)"
27189
+ ...StyleSheet7.absoluteFillObject,
27190
+ zIndex: 30
27083
27191
  },
27084
27192
  sheet: {
27085
- position: "absolute",
27086
- left: 0,
27087
- right: 0,
27088
- bottom: 0,
27193
+ flex: 1,
27194
+ paddingBottom: 16
27195
+ },
27196
+ sheetBackground: {
27089
27197
  backgroundColor: "#ffffff",
27090
27198
  borderTopLeftRadius: 20,
27091
27199
  borderTopRightRadius: 20,
27092
27200
  borderTopWidth: 1,
27093
- borderTopColor: "#e5e7eb",
27094
- paddingBottom: 16
27201
+ borderTopColor: "#e5e7eb"
27095
27202
  },
27096
27203
  sheetDark: {
27097
27204
  backgroundColor: "#0f1115",
27098
27205
  borderTopColor: "#1f2937"
27099
27206
  },
27207
+ handleContainer: {
27208
+ paddingTop: 10,
27209
+ paddingBottom: 12
27210
+ },
27100
27211
  handle: {
27101
27212
  width: 44,
27102
27213
  height: 4,
27103
27214
  borderRadius: 999,
27104
- backgroundColor: "#cbd5f5",
27105
- alignSelf: "center",
27106
- marginTop: 10,
27107
- marginBottom: 12
27215
+ backgroundColor: "#cbd5f5"
27108
27216
  },
27109
27217
  handleDark: {
27110
27218
  backgroundColor: "#374151"
@@ -27112,12 +27220,16 @@ var styles6 = StyleSheet6.create({
27112
27220
  header: {
27113
27221
  paddingHorizontal: 16,
27114
27222
  marginBottom: 10,
27115
- gap: 4
27223
+ gap: 4,
27224
+ flexDirection: "row",
27225
+ alignItems: "center",
27226
+ justifyContent: "space-between"
27116
27227
  },
27117
27228
  sheetTitle: {
27118
27229
  fontSize: 16,
27119
27230
  fontWeight: "800",
27120
- color: "#111827"
27231
+ color: "#111827",
27232
+ flex: 1
27121
27233
  },
27122
27234
  sheetTitleDark: {
27123
27235
  color: "#f8fafc"
@@ -27137,6 +27249,11 @@ var styles6 = StyleSheet6.create({
27137
27249
  fontWeight: "700",
27138
27250
  color: "#111827"
27139
27251
  },
27252
+ pageStatusHit: {
27253
+ paddingHorizontal: 8,
27254
+ paddingVertical: 4,
27255
+ borderRadius: 8
27256
+ },
27140
27257
  pageStatusDark: {
27141
27258
  color: "#e5e7eb"
27142
27259
  },
@@ -27339,17 +27456,17 @@ var styles6 = StyleSheet6.create({
27339
27456
  var RightSheet_default = RightSheet;
27340
27457
 
27341
27458
  // components/AnnotationEditor.tsx
27342
- import { useEffect as useEffect7, useState as useState6 } from "react";
27459
+ import { useEffect as useEffect7, useState as useState7 } from "react";
27343
27460
  import {
27344
- Modal as Modal3,
27345
- View as View7,
27346
- Text as Text4,
27461
+ Modal as Modal2,
27462
+ View as View8,
27463
+ Text as Text5,
27347
27464
  TextInput as TextInput2,
27348
- Pressable as Pressable5,
27349
- StyleSheet as StyleSheet7
27465
+ Pressable as Pressable6,
27466
+ StyleSheet as StyleSheet8
27350
27467
  } from "react-native";
27351
27468
  import { useViewerStore as useViewerStore7 } from "@papyrus-sdk/core";
27352
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
27469
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
27353
27470
  var AnnotationEditor = () => {
27354
27471
  const {
27355
27472
  annotations,
@@ -27362,7 +27479,7 @@ var AnnotationEditor = () => {
27362
27479
  } = useViewerStore7();
27363
27480
  const annotation = annotations.find((ann) => ann.id === selectedAnnotationId);
27364
27481
  const isEditable = annotation && (annotation.type === "text" || annotation.type === "comment");
27365
- const [draft, setDraft] = useState6("");
27482
+ const [draft, setDraft] = useState7("");
27366
27483
  const isDark = uiTheme === "dark";
27367
27484
  const t = getStrings(locale);
27368
27485
  useEffect7(() => {
@@ -27376,19 +27493,19 @@ var AnnotationEditor = () => {
27376
27493
  updateAnnotation(annotation.id, { content: draft });
27377
27494
  setSelectedAnnotation(null);
27378
27495
  };
27379
- return /* @__PURE__ */ jsx8(
27380
- Modal3,
27496
+ return /* @__PURE__ */ jsx9(
27497
+ Modal2,
27381
27498
  {
27382
27499
  visible: true,
27383
27500
  transparent: true,
27384
27501
  animationType: "fade",
27385
27502
  onRequestClose: handleClose,
27386
- children: /* @__PURE__ */ jsx8(View7, { style: styles7.overlay, children: /* @__PURE__ */ jsxs8(View7, { style: [styles7.card, isDark && styles7.cardDark], children: [
27387
- /* @__PURE__ */ jsx8(Text4, { style: [styles7.title, isDark && styles7.titleDark], children: t.editNote }),
27388
- /* @__PURE__ */ jsx8(
27503
+ children: /* @__PURE__ */ jsx9(View8, { style: styles8.overlay, children: /* @__PURE__ */ jsxs9(View8, { style: [styles8.card, isDark && styles8.cardDark], children: [
27504
+ /* @__PURE__ */ jsx9(Text5, { style: [styles8.title, isDark && styles8.titleDark], children: t.editNote }),
27505
+ /* @__PURE__ */ jsx9(
27389
27506
  TextInput2,
27390
27507
  {
27391
- style: [styles7.input, isDark && styles7.inputDark],
27508
+ style: [styles8.input, isDark && styles8.inputDark],
27392
27509
  value: draft,
27393
27510
  onChangeText: setDraft,
27394
27511
  placeholder: t.notePlaceholder,
@@ -27396,25 +27513,25 @@ var AnnotationEditor = () => {
27396
27513
  multiline: true
27397
27514
  }
27398
27515
  ),
27399
- /* @__PURE__ */ jsxs8(View7, { style: styles7.actions, children: [
27400
- /* @__PURE__ */ jsx8(
27401
- Pressable5,
27516
+ /* @__PURE__ */ jsxs9(View8, { style: styles8.actions, children: [
27517
+ /* @__PURE__ */ jsx9(
27518
+ Pressable6,
27402
27519
  {
27403
27520
  onPress: handleClose,
27404
- style: [styles7.actionButton, styles7.actionCancel],
27405
- children: /* @__PURE__ */ jsx8(Text4, { style: styles7.actionText, children: t.cancel })
27521
+ style: [styles8.actionButton, styles8.actionCancel],
27522
+ children: /* @__PURE__ */ jsx9(Text5, { style: styles8.actionText, children: t.cancel })
27406
27523
  }
27407
27524
  ),
27408
- /* @__PURE__ */ jsx8(
27409
- Pressable5,
27525
+ /* @__PURE__ */ jsx9(
27526
+ Pressable6,
27410
27527
  {
27411
27528
  onPress: handleSave,
27412
27529
  style: [
27413
- styles7.actionButton,
27414
- styles7.actionSave,
27530
+ styles8.actionButton,
27531
+ styles8.actionSave,
27415
27532
  { backgroundColor: accentColor }
27416
27533
  ],
27417
- children: /* @__PURE__ */ jsx8(Text4, { style: [styles7.actionText, styles7.actionTextLight], children: t.save })
27534
+ children: /* @__PURE__ */ jsx9(Text5, { style: [styles8.actionText, styles8.actionTextLight], children: t.save })
27418
27535
  }
27419
27536
  )
27420
27537
  ] })
@@ -27422,7 +27539,7 @@ var AnnotationEditor = () => {
27422
27539
  }
27423
27540
  );
27424
27541
  };
27425
- var styles7 = StyleSheet7.create({
27542
+ var styles8 = StyleSheet8.create({
27426
27543
  overlay: {
27427
27544
  flex: 1,
27428
27545
  alignItems: "center",
@@ -27492,7 +27609,7 @@ var styles7 = StyleSheet7.create({
27492
27609
  var AnnotationEditor_default = AnnotationEditor;
27493
27610
 
27494
27611
  // components/BottomBar.tsx
27495
- import { View as View8, Pressable as Pressable6, StyleSheet as StyleSheet8 } from "react-native";
27612
+ import { View as View9, Pressable as Pressable7, StyleSheet as StyleSheet9 } from "react-native";
27496
27613
  import { useViewerStore as useViewerStore8 } from "@papyrus-sdk/core";
27497
27614
 
27498
27615
  // components/bottomBarModel.ts
@@ -27531,8 +27648,15 @@ function buildBottomBarLayout({
27531
27648
  };
27532
27649
  }
27533
27650
 
27651
+ // components/BottomBar.actions.ts
27652
+ function createOpenDestinationHandler(onOpenDestination, destination) {
27653
+ return () => {
27654
+ onOpenDestination?.(destination);
27655
+ };
27656
+ }
27657
+
27534
27658
  // components/BottomBar.tsx
27535
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
27659
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
27536
27660
  var BottomBar = ({
27537
27661
  documentType,
27538
27662
  onOpenInfo,
@@ -27577,19 +27701,19 @@ var BottomBar = ({
27577
27701
  });
27578
27702
  return;
27579
27703
  }
27580
- onOpenDestination("annotate");
27704
+ onOpenDestination?.("annotate");
27581
27705
  setDocumentState({ toolDockOpen: true });
27582
27706
  }
27583
27707
  },
27584
27708
  notes: {
27585
27709
  label: t.notes,
27586
27710
  icon: IconComment,
27587
- onPress: () => onOpenDestination("notes")
27711
+ onPress: createOpenDestinationHandler(onOpenDestination, "notes")
27588
27712
  },
27589
27713
  search: {
27590
27714
  label: t.search,
27591
27715
  icon: IconSearch,
27592
- onPress: () => onOpenDestination("search")
27716
+ onPress: createOpenDestinationHandler(onOpenDestination, "search")
27593
27717
  },
27594
27718
  info: {
27595
27719
  label: t.info,
@@ -27603,37 +27727,43 @@ var BottomBar = ({
27603
27727
  }
27604
27728
  };
27605
27729
  if (!mobileChromeVisible || !mobileDockVisible) return null;
27606
- return /* @__PURE__ */ jsx9(View8, { pointerEvents: "box-none", style: styles8.frame, children: /* @__PURE__ */ jsxs9(View8, { style: styles8.row, children: [
27607
- layout.leftSlots.length > 0 ? /* @__PURE__ */ jsx9(
27608
- View8,
27730
+ return /* @__PURE__ */ jsx10(View9, { pointerEvents: "box-none", style: styles9.frame, children: /* @__PURE__ */ jsxs10(View9, { style: styles9.row, children: [
27731
+ layout.leftSlots.length > 0 ? /* @__PURE__ */ jsx10(
27732
+ View9,
27609
27733
  {
27610
27734
  style: [
27611
- styles8.island,
27612
- styles8.editIsland,
27613
- isDark && styles8.islandDark
27735
+ styles9.island,
27736
+ styles9.editIsland,
27737
+ isDark && styles9.islandDark
27614
27738
  ],
27615
27739
  testID: "papyrus-floating-bottom-dock-edit",
27616
27740
  children: layout.leftSlots.map((slot) => {
27617
27741
  const meta = slotMeta[slot.key];
27618
27742
  const Icon = meta.icon;
27619
- return /* @__PURE__ */ jsx9(
27620
- Pressable6,
27743
+ return /* @__PURE__ */ jsx10(
27744
+ Pressable7,
27621
27745
  {
27622
27746
  onPress: meta.onPress,
27623
27747
  style: [
27624
- styles8.iconOnlyItem,
27625
- slot.active && styles8.itemActive
27748
+ styles9.iconOnlyItem,
27749
+ slot.active && styles9.itemActive
27626
27750
  ],
27627
27751
  accessibilityLabel: meta.label,
27628
- children: /* @__PURE__ */ jsx9(
27629
- View8,
27752
+ children: /* @__PURE__ */ jsx10(
27753
+ View9,
27630
27754
  {
27631
27755
  style: [
27632
- styles8.itemIcon,
27633
- isDark && styles8.itemIconDark,
27634
- slot.active && styles8.itemIconActive
27756
+ styles9.itemIcon,
27757
+ isDark && styles9.itemIconDark,
27758
+ slot.active && styles9.itemIconActive
27635
27759
  ],
27636
- children: /* @__PURE__ */ jsx9(Icon, { size: 17, color: iconColor(slot.active) })
27760
+ children: /* @__PURE__ */ jsx10(
27761
+ Icon,
27762
+ {
27763
+ size: MOBILE_CHROME_METRICS.iconSize,
27764
+ color: iconColor(slot.active)
27765
+ }
27766
+ )
27637
27767
  }
27638
27768
  )
27639
27769
  },
@@ -27642,33 +27772,39 @@ var BottomBar = ({
27642
27772
  })
27643
27773
  }
27644
27774
  ) : null,
27645
- /* @__PURE__ */ jsx9(
27646
- View8,
27775
+ /* @__PURE__ */ jsx10(
27776
+ View9,
27647
27777
  {
27648
27778
  style: [
27649
- styles8.island,
27650
- styles8.utilityIsland,
27651
- isDark && styles8.islandDark
27779
+ styles9.island,
27780
+ styles9.utilityIsland,
27781
+ isDark && styles9.islandDark
27652
27782
  ],
27653
27783
  testID: "papyrus-floating-bottom-dock",
27654
27784
  children: layout.rightSlots.map((slot) => {
27655
27785
  const meta = slotMeta[slot.key];
27656
27786
  const Icon = meta.icon;
27657
- return /* @__PURE__ */ jsx9(
27658
- Pressable6,
27787
+ return /* @__PURE__ */ jsx10(
27788
+ Pressable7,
27659
27789
  {
27660
27790
  onPress: meta.onPress,
27661
- style: [styles8.iconOnlyItem, slot.active && styles8.itemActive],
27791
+ style: [styles9.iconOnlyItem, slot.active && styles9.itemActive],
27662
27792
  accessibilityLabel: meta.label,
27663
- children: /* @__PURE__ */ jsx9(
27664
- View8,
27793
+ children: /* @__PURE__ */ jsx10(
27794
+ View9,
27665
27795
  {
27666
27796
  style: [
27667
- styles8.itemIcon,
27668
- isDark && styles8.itemIconDark,
27669
- slot.active && styles8.itemIconActive
27797
+ styles9.itemIcon,
27798
+ isDark && styles9.itemIconDark,
27799
+ slot.active && styles9.itemIconActive
27670
27800
  ],
27671
- children: /* @__PURE__ */ jsx9(Icon, { size: 17, color: iconColor(slot.active) })
27801
+ children: /* @__PURE__ */ jsx10(
27802
+ Icon,
27803
+ {
27804
+ size: MOBILE_CHROME_METRICS.iconSize,
27805
+ color: iconColor(slot.active)
27806
+ }
27807
+ )
27672
27808
  }
27673
27809
  )
27674
27810
  },
@@ -27679,20 +27815,20 @@ var BottomBar = ({
27679
27815
  )
27680
27816
  ] }) });
27681
27817
  };
27682
- var styles8 = StyleSheet8.create({
27818
+ var styles9 = StyleSheet9.create({
27683
27819
  frame: {
27684
27820
  position: "absolute",
27685
27821
  left: 0,
27686
27822
  right: 0,
27687
27823
  bottom: 0,
27688
27824
  zIndex: 20,
27689
- paddingHorizontal: 12,
27825
+ paddingHorizontal: MOBILE_CHROME_METRICS.screenPadding,
27690
27826
  paddingBottom: 14,
27691
27827
  alignItems: "center"
27692
27828
  },
27693
27829
  row: {
27694
27830
  width: "100%",
27695
- maxWidth: 360,
27831
+ maxWidth: MOBILE_CHROME_METRICS.maxFloatingWidth,
27696
27832
  flexDirection: "row",
27697
27833
  justifyContent: "flex-start",
27698
27834
  alignItems: "center",
@@ -27730,15 +27866,15 @@ var styles8 = StyleSheet8.create({
27730
27866
  iconOnlyItem: {
27731
27867
  alignItems: "center",
27732
27868
  justifyContent: "center",
27733
- paddingHorizontal: 4,
27734
- paddingVertical: 2
27869
+ paddingHorizontal: MOBILE_CHROME_METRICS.bottomBarItemPaddingHorizontal,
27870
+ paddingVertical: MOBILE_CHROME_METRICS.bottomBarItemPaddingVertical
27735
27871
  },
27736
27872
  itemActive: {
27737
27873
  transform: [{ translateY: -2 }]
27738
27874
  },
27739
27875
  itemIcon: {
27740
- width: 22,
27741
- height: 22,
27876
+ width: MOBILE_CHROME_METRICS.iconBoxSize,
27877
+ height: MOBILE_CHROME_METRICS.iconBoxSize,
27742
27878
  borderRadius: 0,
27743
27879
  backgroundColor: "transparent",
27744
27880
  alignItems: "center",
@@ -27756,9 +27892,14 @@ var styles8 = StyleSheet8.create({
27756
27892
  var BottomBar_default = BottomBar;
27757
27893
 
27758
27894
  // components/SettingsSheet.tsx
27759
- import { Modal as Modal4, View as View9, Text as Text5, Pressable as Pressable7, StyleSheet as StyleSheet9 } from "react-native";
27895
+ import { useCallback as useCallback4, useMemo as useMemo6 } from "react";
27896
+ import { Dimensions as Dimensions2, View as View10, Text as Text6, Pressable as Pressable8, StyleSheet as StyleSheet10 } from "react-native";
27897
+ import BottomSheet2, {
27898
+ BottomSheetBackdrop as BottomSheetBackdrop2,
27899
+ BottomSheetScrollView as BottomSheetScrollView2
27900
+ } from "@gorhom/bottom-sheet";
27760
27901
  import { useViewerStore as useViewerStore9 } from "@papyrus-sdk/core";
27761
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
27902
+ import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
27762
27903
  var PAGE_THEME_OPTIONS = [
27763
27904
  { value: "normal", labelKey: "themeOriginal" },
27764
27905
  { value: "sepia", labelKey: "themeSepia" },
@@ -27767,19 +27908,19 @@ var PAGE_THEME_OPTIONS = [
27767
27908
  ];
27768
27909
  var ThemeSwatch = ({ value }) => {
27769
27910
  if (value === "high-contrast") {
27770
- return /* @__PURE__ */ jsxs10(View9, { style: [styles9.themeSwatch, styles9.themeSwatchContrast], children: [
27771
- /* @__PURE__ */ jsx10(View9, { style: styles9.themeSwatchContrastHalfDark }),
27772
- /* @__PURE__ */ jsx10(View9, { style: styles9.themeSwatchContrastHalfLight })
27911
+ return /* @__PURE__ */ jsxs11(View10, { style: [styles10.themeSwatch, styles10.themeSwatchContrast], children: [
27912
+ /* @__PURE__ */ jsx11(View10, { style: styles10.themeSwatchContrastHalfDark }),
27913
+ /* @__PURE__ */ jsx11(View10, { style: styles10.themeSwatchContrastHalfLight })
27773
27914
  ] });
27774
27915
  }
27775
- return /* @__PURE__ */ jsx10(
27776
- View9,
27916
+ return /* @__PURE__ */ jsx11(
27917
+ View10,
27777
27918
  {
27778
27919
  style: [
27779
- styles9.themeSwatch,
27780
- value === "normal" && styles9.themeSwatchNormal,
27781
- value === "sepia" && styles9.themeSwatchSepia,
27782
- value === "dark" && styles9.themeSwatchDark
27920
+ styles10.themeSwatch,
27921
+ value === "normal" && styles10.themeSwatchNormal,
27922
+ value === "sepia" && styles10.themeSwatchSepia,
27923
+ value === "dark" && styles10.themeSwatchDark
27783
27924
  ]
27784
27925
  }
27785
27926
  );
@@ -27802,6 +27943,23 @@ var SettingsSheet = ({
27802
27943
  const isPaged = viewMode === "single";
27803
27944
  const isDouble = viewMode === "double";
27804
27945
  const t = getStrings(locale);
27946
+ const snapPoints = useMemo6(
27947
+ () => [Math.min(640, Dimensions2.get("window").height * 0.72)],
27948
+ []
27949
+ );
27950
+ const renderBackdrop = useCallback4(
27951
+ (props) => /* @__PURE__ */ jsx11(
27952
+ BottomSheetBackdrop2,
27953
+ {
27954
+ ...props,
27955
+ appearsOnIndex: 0,
27956
+ disappearsOnIndex: -1,
27957
+ opacity: 0.4,
27958
+ pressBehavior: "close"
27959
+ }
27960
+ ),
27961
+ []
27962
+ );
27805
27963
  const handleTransition = (mode) => {
27806
27964
  if (mode === "paged") {
27807
27965
  setDocumentState({ viewMode: "single" });
@@ -27828,366 +27986,380 @@ var SettingsSheet = ({
27828
27986
  setDocumentState({ zoom: next });
27829
27987
  };
27830
27988
  if (!visible) return null;
27831
- return /* @__PURE__ */ jsx10(Modal4, { visible: true, transparent: true, animationType: "slide", onRequestClose: onClose, children: /* @__PURE__ */ jsxs10(View9, { style: styles9.modalRoot, children: [
27832
- /* @__PURE__ */ jsx10(Pressable7, { style: styles9.backdrop, onPress: onClose }),
27833
- /* @__PURE__ */ jsxs10(View9, { style: [styles9.sheet, isDark && styles9.sheetDark], children: [
27834
- /* @__PURE__ */ jsx10(View9, { style: [styles9.handle, isDark && styles9.handleDark] }),
27835
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
27836
- /* @__PURE__ */ jsx10(
27837
- Text5,
27838
- {
27839
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
27840
- children: t.appearance
27841
- }
27842
- ),
27843
- /* @__PURE__ */ jsxs10(View9, { style: styles9.optionRow, children: [
27844
- /* @__PURE__ */ jsx10(
27845
- Pressable7,
27846
- {
27847
- onPress: () => setDocumentState({ uiTheme: "light" }),
27848
- style: [
27849
- styles9.optionButton,
27850
- isDark && styles9.optionButtonDark,
27851
- uiTheme === "light" && styles9.optionButtonActive,
27852
- uiTheme === "light" && { backgroundColor: accentColor }
27853
- ],
27854
- children: /* @__PURE__ */ jsx10(
27855
- Text5,
27856
- {
27857
- style: [
27858
- styles9.optionText,
27859
- isDark && styles9.optionTextDark,
27860
- uiTheme === "light" && styles9.optionTextActive
27861
- ],
27862
- children: t.light
27863
- }
27864
- )
27865
- }
27866
- ),
27867
- /* @__PURE__ */ jsx10(
27868
- Pressable7,
27869
- {
27870
- onPress: () => setDocumentState({ uiTheme: "dark" }),
27871
- style: [
27872
- styles9.optionButton,
27873
- isDark && styles9.optionButtonDark,
27874
- uiTheme === "dark" && styles9.optionButtonActive,
27875
- uiTheme === "dark" && { backgroundColor: accentColor }
27876
- ],
27877
- children: /* @__PURE__ */ jsx10(
27878
- Text5,
27989
+ return /* @__PURE__ */ jsx11(View10, { style: styles10.modalRoot, pointerEvents: "box-none", children: /* @__PURE__ */ jsx11(
27990
+ BottomSheet2,
27991
+ {
27992
+ index: 0,
27993
+ snapPoints,
27994
+ enablePanDownToClose: true,
27995
+ onClose,
27996
+ backdropComponent: renderBackdrop,
27997
+ backgroundStyle: [styles10.sheetBackground, isDark && styles10.sheetDark],
27998
+ handleIndicatorStyle: [styles10.handle, isDark && styles10.handleDark],
27999
+ handleStyle: styles10.handleContainer,
28000
+ children: /* @__PURE__ */ jsxs11(
28001
+ BottomSheetScrollView2,
28002
+ {
28003
+ style: styles10.sheet,
28004
+ contentContainerStyle: styles10.sheetContent,
28005
+ showsVerticalScrollIndicator: false,
28006
+ children: [
28007
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28008
+ /* @__PURE__ */ jsx11(
28009
+ Text6,
27879
28010
  {
27880
- style: [
27881
- styles9.optionText,
27882
- isDark && styles9.optionTextDark,
27883
- uiTheme === "dark" && styles9.optionTextActive
27884
- ],
27885
- children: t.dark
28011
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28012
+ children: t.appearance
27886
28013
  }
27887
- )
27888
- }
27889
- )
27890
- ] })
27891
- ] }),
27892
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
27893
- /* @__PURE__ */ jsx10(
27894
- Text5,
27895
- {
27896
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
27897
- children: t.pageTheme
27898
- }
27899
- ),
27900
- /* @__PURE__ */ jsx10(View9, { style: styles9.themeOptionRow, children: PAGE_THEME_OPTIONS.map((option) => {
27901
- const active = pageTheme === option.value;
27902
- return /* @__PURE__ */ jsxs10(
27903
- Pressable7,
27904
- {
27905
- onPress: () => setDocumentState({ pageTheme: option.value }),
27906
- style: [
27907
- styles9.themeOptionButton,
27908
- isDark && styles9.themeOptionButtonDark,
27909
- active && styles9.themeOptionButtonActive,
27910
- active && { borderColor: accentColor }
27911
- ],
27912
- children: [
27913
- /* @__PURE__ */ jsx10(ThemeSwatch, { value: option.value }),
27914
- /* @__PURE__ */ jsx10(
27915
- Text5,
28014
+ ),
28015
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.optionRow, children: [
28016
+ /* @__PURE__ */ jsx11(
28017
+ Pressable8,
27916
28018
  {
28019
+ onPress: () => setDocumentState({ uiTheme: "light" }),
27917
28020
  style: [
27918
- styles9.themeOptionLabel,
27919
- isDark && styles9.themeOptionLabelDark,
27920
- active && { color: accentColor }
28021
+ styles10.optionButton,
28022
+ isDark && styles10.optionButtonDark,
28023
+ uiTheme === "light" && styles10.optionButtonActive,
28024
+ uiTheme === "light" && { backgroundColor: accentColor }
27921
28025
  ],
27922
- children: t[option.labelKey]
28026
+ children: /* @__PURE__ */ jsx11(
28027
+ Text6,
28028
+ {
28029
+ style: [
28030
+ styles10.optionText,
28031
+ isDark && styles10.optionTextDark,
28032
+ uiTheme === "light" && styles10.optionTextActive
28033
+ ],
28034
+ children: t.light
28035
+ }
28036
+ )
28037
+ }
28038
+ ),
28039
+ /* @__PURE__ */ jsx11(
28040
+ Pressable8,
28041
+ {
28042
+ onPress: () => setDocumentState({ uiTheme: "dark" }),
28043
+ style: [
28044
+ styles10.optionButton,
28045
+ isDark && styles10.optionButtonDark,
28046
+ uiTheme === "dark" && styles10.optionButtonActive,
28047
+ uiTheme === "dark" && { backgroundColor: accentColor }
28048
+ ],
28049
+ children: /* @__PURE__ */ jsx11(
28050
+ Text6,
28051
+ {
28052
+ style: [
28053
+ styles10.optionText,
28054
+ isDark && styles10.optionTextDark,
28055
+ uiTheme === "dark" && styles10.optionTextActive
28056
+ ],
28057
+ children: t.dark
28058
+ }
28059
+ )
27923
28060
  }
27924
28061
  )
27925
- ]
27926
- },
27927
- option.value
27928
- );
27929
- }) })
27930
- ] }),
27931
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
27932
- /* @__PURE__ */ jsx10(
27933
- Text5,
27934
- {
27935
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
27936
- children: t.pageTransition
27937
- }
27938
- ),
27939
- /* @__PURE__ */ jsxs10(View9, { style: styles9.optionRow, children: [
27940
- /* @__PURE__ */ jsx10(
27941
- Pressable7,
27942
- {
27943
- onPress: () => handleTransition("continuous"),
27944
- style: [
27945
- styles9.optionButton,
27946
- isDark && styles9.optionButtonDark,
27947
- (!isPaged || isDouble) && styles9.optionButtonActive,
27948
- (!isPaged || isDouble) && { backgroundColor: accentColor }
27949
- ],
27950
- children: /* @__PURE__ */ jsx10(
27951
- Text5,
27952
- {
27953
- style: [
27954
- styles9.optionText,
27955
- isDark && styles9.optionTextDark,
27956
- (!isPaged || isDouble) && styles9.optionTextActive
27957
- ],
27958
- children: t.continuous
27959
- }
27960
- )
27961
- }
27962
- ),
27963
- /* @__PURE__ */ jsx10(
27964
- Pressable7,
27965
- {
27966
- onPress: () => handleTransition("paged"),
27967
- style: [
27968
- styles9.optionButton,
27969
- isDark && styles9.optionButtonDark,
27970
- isPaged && styles9.optionButtonActive,
27971
- isPaged && { backgroundColor: accentColor }
27972
- ],
27973
- children: /* @__PURE__ */ jsx10(
27974
- Text5,
27975
- {
27976
- style: [
27977
- styles9.optionText,
27978
- isDark && styles9.optionTextDark,
27979
- isPaged && styles9.optionTextActive
27980
- ],
27981
- children: t.pageByPage
27982
- }
27983
- )
27984
- }
27985
- )
27986
- ] })
27987
- ] }),
27988
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
27989
- /* @__PURE__ */ jsx10(
27990
- Text5,
27991
- {
27992
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
27993
- children: t.layout
27994
- }
27995
- ),
27996
- /* @__PURE__ */ jsxs10(View9, { style: styles9.optionRow, children: [
27997
- /* @__PURE__ */ jsx10(
27998
- Pressable7,
27999
- {
28000
- onPress: () => handleLayout("single"),
28001
- style: [
28002
- styles9.optionButton,
28003
- isDark && styles9.optionButtonDark,
28004
- !isDouble && styles9.optionButtonActive,
28005
- !isDouble && { backgroundColor: accentColor }
28006
- ],
28007
- children: /* @__PURE__ */ jsx10(
28008
- Text5,
28062
+ ] })
28063
+ ] }),
28064
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28065
+ /* @__PURE__ */ jsx11(
28066
+ Text6,
28009
28067
  {
28010
- style: [
28011
- styles9.optionText,
28012
- isDark && styles9.optionTextDark,
28013
- !isDouble && styles9.optionTextActive
28014
- ],
28015
- children: t.singlePage
28068
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28069
+ children: t.pageTheme
28016
28070
  }
28017
- )
28018
- }
28019
- ),
28020
- /* @__PURE__ */ jsx10(
28021
- Pressable7,
28022
- {
28023
- onPress: () => handleLayout("double"),
28024
- style: [
28025
- styles9.optionButton,
28026
- isDark && styles9.optionButtonDark,
28027
- isDouble && styles9.optionButtonActive,
28028
- isDouble && { backgroundColor: accentColor }
28029
- ],
28030
- children: /* @__PURE__ */ jsx10(
28031
- Text5,
28071
+ ),
28072
+ /* @__PURE__ */ jsx11(View10, { style: styles10.themeOptionRow, children: PAGE_THEME_OPTIONS.map((option) => {
28073
+ const active = pageTheme === option.value;
28074
+ return /* @__PURE__ */ jsxs11(
28075
+ Pressable8,
28076
+ {
28077
+ onPress: () => setDocumentState({ pageTheme: option.value }),
28078
+ style: [
28079
+ styles10.themeOptionButton,
28080
+ isDark && styles10.themeOptionButtonDark,
28081
+ active && styles10.themeOptionButtonActive,
28082
+ active && { borderColor: accentColor }
28083
+ ],
28084
+ children: [
28085
+ /* @__PURE__ */ jsx11(ThemeSwatch, { value: option.value }),
28086
+ /* @__PURE__ */ jsx11(
28087
+ Text6,
28088
+ {
28089
+ style: [
28090
+ styles10.themeOptionLabel,
28091
+ isDark && styles10.themeOptionLabelDark,
28092
+ active && { color: accentColor }
28093
+ ],
28094
+ children: t[option.labelKey]
28095
+ }
28096
+ )
28097
+ ]
28098
+ },
28099
+ option.value
28100
+ );
28101
+ }) })
28102
+ ] }),
28103
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28104
+ /* @__PURE__ */ jsx11(
28105
+ Text6,
28032
28106
  {
28033
- style: [
28034
- styles9.optionText,
28035
- isDark && styles9.optionTextDark,
28036
- isDouble && styles9.optionTextActive
28037
- ],
28038
- children: t.doublePage
28107
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28108
+ children: t.pageTransition
28039
28109
  }
28040
- )
28041
- }
28042
- )
28043
- ] })
28044
- ] }),
28045
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
28046
- /* @__PURE__ */ jsx10(
28047
- Text5,
28048
- {
28049
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
28050
- children: t.rotate
28051
- }
28052
- ),
28053
- /* @__PURE__ */ jsxs10(View9, { style: styles9.optionRow, children: [
28054
- /* @__PURE__ */ jsx10(
28055
- Pressable7,
28056
- {
28057
- onPress: () => handleRotate("counterclockwise"),
28058
- style: [styles9.optionButton, isDark && styles9.optionButtonDark],
28059
- children: /* @__PURE__ */ jsx10(
28060
- Text5,
28110
+ ),
28111
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.optionRow, children: [
28112
+ /* @__PURE__ */ jsx11(
28113
+ Pressable8,
28114
+ {
28115
+ onPress: () => handleTransition("continuous"),
28116
+ style: [
28117
+ styles10.optionButton,
28118
+ isDark && styles10.optionButtonDark,
28119
+ (!isPaged || isDouble) && styles10.optionButtonActive,
28120
+ (!isPaged || isDouble) && { backgroundColor: accentColor }
28121
+ ],
28122
+ children: /* @__PURE__ */ jsx11(
28123
+ Text6,
28124
+ {
28125
+ style: [
28126
+ styles10.optionText,
28127
+ isDark && styles10.optionTextDark,
28128
+ (!isPaged || isDouble) && styles10.optionTextActive
28129
+ ],
28130
+ children: t.continuous
28131
+ }
28132
+ )
28133
+ }
28134
+ ),
28135
+ /* @__PURE__ */ jsx11(
28136
+ Pressable8,
28137
+ {
28138
+ onPress: () => handleTransition("paged"),
28139
+ style: [
28140
+ styles10.optionButton,
28141
+ isDark && styles10.optionButtonDark,
28142
+ isPaged && styles10.optionButtonActive,
28143
+ isPaged && { backgroundColor: accentColor }
28144
+ ],
28145
+ children: /* @__PURE__ */ jsx11(
28146
+ Text6,
28147
+ {
28148
+ style: [
28149
+ styles10.optionText,
28150
+ isDark && styles10.optionTextDark,
28151
+ isPaged && styles10.optionTextActive
28152
+ ],
28153
+ children: t.pageByPage
28154
+ }
28155
+ )
28156
+ }
28157
+ )
28158
+ ] })
28159
+ ] }),
28160
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28161
+ /* @__PURE__ */ jsx11(
28162
+ Text6,
28061
28163
  {
28062
- style: [styles9.optionText, isDark && styles9.optionTextDark],
28063
- children: t.counterclockwise
28164
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28165
+ children: t.layout
28064
28166
  }
28065
- )
28066
- }
28067
- ),
28068
- /* @__PURE__ */ jsx10(
28069
- Pressable7,
28070
- {
28071
- onPress: () => handleRotate("clockwise"),
28072
- style: [styles9.optionButton, isDark && styles9.optionButtonDark],
28073
- children: /* @__PURE__ */ jsx10(
28074
- Text5,
28167
+ ),
28168
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.optionRow, children: [
28169
+ /* @__PURE__ */ jsx11(
28170
+ Pressable8,
28171
+ {
28172
+ onPress: () => handleLayout("single"),
28173
+ style: [
28174
+ styles10.optionButton,
28175
+ isDark && styles10.optionButtonDark,
28176
+ !isDouble && styles10.optionButtonActive,
28177
+ !isDouble && { backgroundColor: accentColor }
28178
+ ],
28179
+ children: /* @__PURE__ */ jsx11(
28180
+ Text6,
28181
+ {
28182
+ style: [
28183
+ styles10.optionText,
28184
+ isDark && styles10.optionTextDark,
28185
+ !isDouble && styles10.optionTextActive
28186
+ ],
28187
+ children: t.singlePage
28188
+ }
28189
+ )
28190
+ }
28191
+ ),
28192
+ /* @__PURE__ */ jsx11(
28193
+ Pressable8,
28194
+ {
28195
+ onPress: () => handleLayout("double"),
28196
+ style: [
28197
+ styles10.optionButton,
28198
+ isDark && styles10.optionButtonDark,
28199
+ isDouble && styles10.optionButtonActive,
28200
+ isDouble && { backgroundColor: accentColor }
28201
+ ],
28202
+ children: /* @__PURE__ */ jsx11(
28203
+ Text6,
28204
+ {
28205
+ style: [
28206
+ styles10.optionText,
28207
+ isDark && styles10.optionTextDark,
28208
+ isDouble && styles10.optionTextActive
28209
+ ],
28210
+ children: t.doublePage
28211
+ }
28212
+ )
28213
+ }
28214
+ )
28215
+ ] })
28216
+ ] }),
28217
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28218
+ /* @__PURE__ */ jsx11(
28219
+ Text6,
28075
28220
  {
28076
- style: [styles9.optionText, isDark && styles9.optionTextDark],
28077
- children: t.clockwise
28221
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28222
+ children: t.rotate
28078
28223
  }
28079
- )
28080
- }
28081
- )
28082
- ] })
28083
- ] }),
28084
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
28085
- /* @__PURE__ */ jsx10(
28086
- Text5,
28087
- {
28088
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
28089
- children: t.zoom
28090
- }
28091
- ),
28092
- /* @__PURE__ */ jsxs10(View9, { style: styles9.optionRow, children: [
28093
- /* @__PURE__ */ jsx10(
28094
- Pressable7,
28095
- {
28096
- onPress: () => handleZoom(-0.1),
28097
- style: [styles9.optionButton, isDark && styles9.optionButtonDark],
28098
- children: /* @__PURE__ */ jsx10(IconZoomOut, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
28099
- }
28100
- ),
28101
- /* @__PURE__ */ jsx10(View9, { style: styles9.zoomValue, children: /* @__PURE__ */ jsxs10(Text5, { style: [styles9.zoomText, isDark && styles9.zoomTextDark], children: [
28102
- Math.round(zoom * 100),
28103
- "%"
28104
- ] }) }),
28105
- /* @__PURE__ */ jsx10(
28106
- Pressable7,
28107
- {
28108
- onPress: () => handleZoom(0.1),
28109
- style: [styles9.optionButton, isDark && styles9.optionButtonDark],
28110
- children: /* @__PURE__ */ jsx10(IconZoomIn, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
28111
- }
28112
- )
28113
- ] })
28114
- ] }),
28115
- /* @__PURE__ */ jsxs10(View9, { style: styles9.section, children: [
28116
- /* @__PURE__ */ jsx10(
28117
- Text5,
28118
- {
28119
- style: [styles9.sectionTitle, isDark && styles9.sectionTitleDark],
28120
- children: t.language
28121
- }
28122
- ),
28123
- /* @__PURE__ */ jsxs10(View9, { style: styles9.optionRow, children: [
28124
- /* @__PURE__ */ jsx10(
28125
- Pressable7,
28126
- {
28127
- onPress: () => setDocumentState({ locale: "en" }),
28128
- style: [
28129
- styles9.optionButton,
28130
- isDark && styles9.optionButtonDark,
28131
- locale === "en" && styles9.optionButtonActive,
28132
- locale === "en" && { backgroundColor: accentColor }
28133
- ],
28134
- children: /* @__PURE__ */ jsx10(
28135
- Text5,
28224
+ ),
28225
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.optionRow, children: [
28226
+ /* @__PURE__ */ jsx11(
28227
+ Pressable8,
28228
+ {
28229
+ onPress: () => handleRotate("counterclockwise"),
28230
+ style: [styles10.optionButton, isDark && styles10.optionButtonDark],
28231
+ children: /* @__PURE__ */ jsx11(
28232
+ Text6,
28233
+ {
28234
+ style: [styles10.optionText, isDark && styles10.optionTextDark],
28235
+ children: t.counterclockwise
28236
+ }
28237
+ )
28238
+ }
28239
+ ),
28240
+ /* @__PURE__ */ jsx11(
28241
+ Pressable8,
28242
+ {
28243
+ onPress: () => handleRotate("clockwise"),
28244
+ style: [styles10.optionButton, isDark && styles10.optionButtonDark],
28245
+ children: /* @__PURE__ */ jsx11(
28246
+ Text6,
28247
+ {
28248
+ style: [styles10.optionText, isDark && styles10.optionTextDark],
28249
+ children: t.clockwise
28250
+ }
28251
+ )
28252
+ }
28253
+ )
28254
+ ] })
28255
+ ] }),
28256
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28257
+ /* @__PURE__ */ jsx11(
28258
+ Text6,
28136
28259
  {
28137
- style: [
28138
- styles9.optionText,
28139
- isDark && styles9.optionTextDark,
28140
- locale === "en" && styles9.optionTextActive
28141
- ],
28142
- children: t.english
28260
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28261
+ children: t.zoom
28143
28262
  }
28144
- )
28145
- }
28146
- ),
28147
- /* @__PURE__ */ jsx10(
28148
- Pressable7,
28149
- {
28150
- onPress: () => setDocumentState({ locale: "pt-BR" }),
28151
- style: [
28152
- styles9.optionButton,
28153
- isDark && styles9.optionButtonDark,
28154
- locale === "pt-BR" && styles9.optionButtonActive,
28155
- locale === "pt-BR" && { backgroundColor: accentColor }
28156
- ],
28157
- children: /* @__PURE__ */ jsx10(
28158
- Text5,
28263
+ ),
28264
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.optionRow, children: [
28265
+ /* @__PURE__ */ jsx11(
28266
+ Pressable8,
28267
+ {
28268
+ onPress: () => handleZoom(-0.1),
28269
+ style: [styles10.optionButton, isDark && styles10.optionButtonDark],
28270
+ children: /* @__PURE__ */ jsx11(IconZoomOut, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
28271
+ }
28272
+ ),
28273
+ /* @__PURE__ */ jsx11(View10, { style: styles10.zoomValue, children: /* @__PURE__ */ jsxs11(Text6, { style: [styles10.zoomText, isDark && styles10.zoomTextDark], children: [
28274
+ Math.round(zoom * 100),
28275
+ "%"
28276
+ ] }) }),
28277
+ /* @__PURE__ */ jsx11(
28278
+ Pressable8,
28279
+ {
28280
+ onPress: () => handleZoom(0.1),
28281
+ style: [styles10.optionButton, isDark && styles10.optionButtonDark],
28282
+ children: /* @__PURE__ */ jsx11(IconZoomIn, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
28283
+ }
28284
+ )
28285
+ ] })
28286
+ ] }),
28287
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.section, children: [
28288
+ /* @__PURE__ */ jsx11(
28289
+ Text6,
28159
28290
  {
28160
- style: [
28161
- styles9.optionText,
28162
- isDark && styles9.optionTextDark,
28163
- locale === "pt-BR" && styles9.optionTextActive
28164
- ],
28165
- children: t.portuguese
28291
+ style: [styles10.sectionTitle, isDark && styles10.sectionTitleDark],
28292
+ children: t.language
28166
28293
  }
28167
- )
28168
- }
28169
- )
28170
- ] })
28171
- ] })
28172
- ] })
28173
- ] }) });
28294
+ ),
28295
+ /* @__PURE__ */ jsxs11(View10, { style: styles10.optionRow, children: [
28296
+ /* @__PURE__ */ jsx11(
28297
+ Pressable8,
28298
+ {
28299
+ onPress: () => setDocumentState({ locale: "en" }),
28300
+ style: [
28301
+ styles10.optionButton,
28302
+ isDark && styles10.optionButtonDark,
28303
+ locale === "en" && styles10.optionButtonActive,
28304
+ locale === "en" && { backgroundColor: accentColor }
28305
+ ],
28306
+ children: /* @__PURE__ */ jsx11(
28307
+ Text6,
28308
+ {
28309
+ style: [
28310
+ styles10.optionText,
28311
+ isDark && styles10.optionTextDark,
28312
+ locale === "en" && styles10.optionTextActive
28313
+ ],
28314
+ children: t.english
28315
+ }
28316
+ )
28317
+ }
28318
+ ),
28319
+ /* @__PURE__ */ jsx11(
28320
+ Pressable8,
28321
+ {
28322
+ onPress: () => setDocumentState({ locale: "pt-BR" }),
28323
+ style: [
28324
+ styles10.optionButton,
28325
+ isDark && styles10.optionButtonDark,
28326
+ locale === "pt-BR" && styles10.optionButtonActive,
28327
+ locale === "pt-BR" && { backgroundColor: accentColor }
28328
+ ],
28329
+ children: /* @__PURE__ */ jsx11(
28330
+ Text6,
28331
+ {
28332
+ style: [
28333
+ styles10.optionText,
28334
+ isDark && styles10.optionTextDark,
28335
+ locale === "pt-BR" && styles10.optionTextActive
28336
+ ],
28337
+ children: t.portuguese
28338
+ }
28339
+ )
28340
+ }
28341
+ )
28342
+ ] })
28343
+ ] })
28344
+ ]
28345
+ }
28346
+ )
28347
+ }
28348
+ ) });
28174
28349
  };
28175
- var styles9 = StyleSheet9.create({
28350
+ var styles10 = StyleSheet10.create({
28176
28351
  modalRoot: {
28177
- flex: 1,
28178
- backgroundColor: "transparent"
28179
- },
28180
- backdrop: {
28181
- ...StyleSheet9.absoluteFillObject,
28182
- backgroundColor: "rgba(0, 0, 0, 0.45)"
28352
+ ...StyleSheet10.absoluteFillObject,
28353
+ zIndex: 30
28183
28354
  },
28184
28355
  sheet: {
28185
- position: "absolute",
28186
- left: 0,
28187
- right: 0,
28188
- bottom: 0,
28356
+ flex: 1
28357
+ },
28358
+ sheetContent: {
28189
28359
  paddingHorizontal: 18,
28190
- paddingBottom: 24,
28360
+ paddingBottom: 24
28361
+ },
28362
+ sheetBackground: {
28191
28363
  backgroundColor: "#ffffff",
28192
28364
  borderTopLeftRadius: 24,
28193
28365
  borderTopRightRadius: 24,
@@ -28198,14 +28370,15 @@ var styles9 = StyleSheet9.create({
28198
28370
  backgroundColor: "#0f1115",
28199
28371
  borderTopColor: "#1f2937"
28200
28372
  },
28373
+ handleContainer: {
28374
+ paddingTop: 10,
28375
+ paddingBottom: 12
28376
+ },
28201
28377
  handle: {
28202
28378
  width: 44,
28203
28379
  height: 4,
28204
28380
  borderRadius: 999,
28205
- backgroundColor: "#cbd5f5",
28206
- alignSelf: "center",
28207
- marginTop: 10,
28208
- marginBottom: 12
28381
+ backgroundColor: "#cbd5f5"
28209
28382
  },
28210
28383
  handleDark: {
28211
28384
  backgroundColor: "#374151"
@@ -28335,17 +28508,17 @@ var styles9 = StyleSheet9.create({
28335
28508
  var SettingsSheet_default = SettingsSheet;
28336
28509
 
28337
28510
  // components/CoverPreview.tsx
28338
- import { useEffect as useEffect8, useMemo as useMemo6, useRef as useRef6, useState as useState7 } from "react";
28511
+ import { useEffect as useEffect8, useMemo as useMemo7, useRef as useRef6, useState as useState8 } from "react";
28339
28512
  import {
28340
28513
  ActivityIndicator,
28341
- StyleSheet as StyleSheet10,
28342
- Text as Text6,
28514
+ StyleSheet as StyleSheet11,
28515
+ Text as Text7,
28343
28516
  UIManager as UIManager2,
28344
- View as View10,
28517
+ View as View11,
28345
28518
  findNodeHandle as findNodeHandle3
28346
28519
  } from "react-native";
28347
28520
  import { MobileDocumentEngine, PapyrusPageView as PapyrusPageView3 } from "@papyrus-sdk/engine-native";
28348
- import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
28521
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
28349
28522
  var parseDataUri = (value) => {
28350
28523
  const match = /^data:([^;,]+)?(;base64)?,/.exec(value);
28351
28524
  if (!match) return null;
@@ -28393,13 +28566,13 @@ var CoverPreview = ({
28393
28566
  onLoadEnd,
28394
28567
  onError
28395
28568
  }) => {
28396
- const [engine, setEngine] = useState7(null);
28397
- const [layoutReady, setLayoutReady] = useState7(false);
28398
- const [loaded, setLoaded] = useState7(false);
28399
- const [loading, setLoading] = useState7(false);
28400
- const [error, setError] = useState7(null);
28569
+ const [engine, setEngine] = useState8(null);
28570
+ const [layoutReady, setLayoutReady] = useState8(false);
28571
+ const [loaded, setLoaded] = useState8(false);
28572
+ const [loading, setLoading] = useState8(false);
28573
+ const [error, setError] = useState8(null);
28401
28574
  const viewRef = useRef6(null);
28402
- const resolvedType = useMemo6(() => inferDocumentType(source, type), [source, type]);
28575
+ const resolvedType = useMemo7(() => inferDocumentType(source, type), [source, type]);
28403
28576
  const isPdf = resolvedType === "pdf";
28404
28577
  const hasNativePageView = Boolean(UIManager2.getViewManagerConfig?.("PapyrusPageView"));
28405
28578
  const canRender = !isPdf || hasNativePageView;
@@ -28462,15 +28635,15 @@ var CoverPreview = ({
28462
28635
  }
28463
28636
  };
28464
28637
  if (!shouldRender || !canRender) {
28465
- return /* @__PURE__ */ jsx11(View10, { style: [styles10.container, style], children: placeholder ?? /* @__PURE__ */ jsx11(View10, { style: styles10.placeholder, children: /* @__PURE__ */ jsx11(Text6, { style: styles10.placeholderText, children: "Preview" }) }) });
28638
+ return /* @__PURE__ */ jsx12(View11, { style: [styles11.container, style], children: placeholder ?? /* @__PURE__ */ jsx12(View11, { style: styles11.placeholder, children: /* @__PURE__ */ jsx12(Text7, { style: styles11.placeholderText, children: "Preview" }) }) });
28466
28639
  }
28467
- return /* @__PURE__ */ jsxs11(View10, { style: [styles10.container, style], onLayout: handleLayout, children: [
28468
- /* @__PURE__ */ jsx11(View10, { style: styles10.previewFrame, pointerEvents: allowInteraction ? "auto" : "none", children: isPdf ? /* @__PURE__ */ jsx11(PapyrusPageView3, { ref: viewRef, style: styles10.pageView }) : engine && /* @__PURE__ */ jsx11(WebViewViewer_default, { engine }) }),
28469
- showLoading && loading && /* @__PURE__ */ jsx11(View10, { pointerEvents: "none", style: styles10.loadingOverlay, children: loadingIndicator ?? /* @__PURE__ */ jsx11(ActivityIndicator, { size: "small", color: "#2563eb" }) }),
28470
- error && /* @__PURE__ */ jsx11(View10, { pointerEvents: "none", style: styles10.errorOverlay, children: /* @__PURE__ */ jsx11(Text6, { style: styles10.errorText, children: "Preview unavailable" }) })
28640
+ return /* @__PURE__ */ jsxs12(View11, { style: [styles11.container, style], onLayout: handleLayout, children: [
28641
+ /* @__PURE__ */ jsx12(View11, { style: styles11.previewFrame, pointerEvents: allowInteraction ? "auto" : "none", children: isPdf ? /* @__PURE__ */ jsx12(PapyrusPageView3, { ref: viewRef, style: styles11.pageView }) : engine && /* @__PURE__ */ jsx12(WebViewViewer_default, { engine }) }),
28642
+ showLoading && loading && /* @__PURE__ */ jsx12(View11, { pointerEvents: "none", style: styles11.loadingOverlay, children: loadingIndicator ?? /* @__PURE__ */ jsx12(ActivityIndicator, { size: "small", color: "#2563eb" }) }),
28643
+ error && /* @__PURE__ */ jsx12(View11, { pointerEvents: "none", style: styles11.errorOverlay, children: /* @__PURE__ */ jsx12(Text7, { style: styles11.errorText, children: "Preview unavailable" }) })
28471
28644
  ] });
28472
28645
  };
28473
- var styles10 = StyleSheet10.create({
28646
+ var styles11 = StyleSheet11.create({
28474
28647
  container: {
28475
28648
  backgroundColor: "#f8fafc",
28476
28649
  borderRadius: 12,
@@ -28486,13 +28659,13 @@ var styles10 = StyleSheet10.create({
28486
28659
  backgroundColor: "transparent"
28487
28660
  },
28488
28661
  loadingOverlay: {
28489
- ...StyleSheet10.absoluteFillObject,
28662
+ ...StyleSheet11.absoluteFillObject,
28490
28663
  alignItems: "center",
28491
28664
  justifyContent: "center",
28492
28665
  backgroundColor: "rgba(15, 23, 42, 0.15)"
28493
28666
  },
28494
28667
  errorOverlay: {
28495
- ...StyleSheet10.absoluteFillObject,
28668
+ ...StyleSheet11.absoluteFillObject,
28496
28669
  alignItems: "center",
28497
28670
  justifyContent: "center",
28498
28671
  backgroundColor: "rgba(15, 23, 42, 0.4)"
@@ -28517,43 +28690,43 @@ var styles10 = StyleSheet10.create({
28517
28690
  var CoverPreview_default = CoverPreview;
28518
28691
 
28519
28692
  // components/ReadingShell.tsx
28520
- import React11, { useState as useState9 } from "react";
28521
- import { Keyboard as Keyboard2, View as View17, StyleSheet as StyleSheet17 } from "react-native";
28693
+ import React13, { useState as useState10 } from "react";
28694
+ import { Keyboard as Keyboard2, View as View18, StyleSheet as StyleSheet18 } from "react-native";
28522
28695
  import { useViewerStore as useViewerStore16 } from "@papyrus-sdk/core";
28523
28696
 
28524
28697
  // components/DocumentActionsSheet.tsx
28525
28698
  import {
28526
- Modal as Modal5,
28527
- Pressable as Pressable8,
28528
- StyleSheet as StyleSheet11,
28529
- Text as Text7,
28530
- View as View11
28699
+ Modal as Modal3,
28700
+ Pressable as Pressable9,
28701
+ StyleSheet as StyleSheet12,
28702
+ Text as Text8,
28703
+ View as View12
28531
28704
  } from "react-native";
28532
28705
  import { useViewerStore as useViewerStore10 } from "@papyrus-sdk/core";
28533
- import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
28706
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
28534
28707
  function DocumentActionsSheet({
28535
28708
  visible,
28536
28709
  onClose
28537
28710
  }) {
28538
28711
  const { uiTheme } = useViewerStore10();
28539
28712
  const isDark = uiTheme === "dark";
28540
- return /* @__PURE__ */ jsx12(Modal5, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx12(Pressable8, { style: styles11.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs12(
28541
- Pressable8,
28713
+ return /* @__PURE__ */ jsx13(Modal3, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx13(Pressable9, { style: styles12.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs13(
28714
+ Pressable9,
28542
28715
  {
28543
28716
  onPress: (event) => event.stopPropagation(),
28544
- style: [styles11.card, isDark && styles11.cardDark],
28717
+ style: [styles12.card, isDark && styles12.cardDark],
28545
28718
  children: [
28546
- /* @__PURE__ */ jsx12(Text7, { style: [styles11.eyebrow, isDark && styles11.eyebrowDark], children: "Document actions" }),
28547
- /* @__PURE__ */ jsxs12(View11, { style: styles11.actionList, children: [
28548
- /* @__PURE__ */ jsx12(View11, { style: [styles11.actionItem, isDark && styles11.actionItemDark], children: /* @__PURE__ */ jsx12(Text7, { style: [styles11.actionText, isDark && styles11.actionTextDark], children: "Share" }) }),
28549
- /* @__PURE__ */ jsx12(View11, { style: [styles11.actionItem, isDark && styles11.actionItemDark], children: /* @__PURE__ */ jsx12(Text7, { style: [styles11.actionText, isDark && styles11.actionTextDark], children: "Export" }) })
28719
+ /* @__PURE__ */ jsx13(Text8, { style: [styles12.eyebrow, isDark && styles12.eyebrowDark], children: "Document actions" }),
28720
+ /* @__PURE__ */ jsxs13(View12, { style: styles12.actionList, children: [
28721
+ /* @__PURE__ */ jsx13(View12, { style: [styles12.actionItem, isDark && styles12.actionItemDark], children: /* @__PURE__ */ jsx13(Text8, { style: [styles12.actionText, isDark && styles12.actionTextDark], children: "Share" }) }),
28722
+ /* @__PURE__ */ jsx13(View12, { style: [styles12.actionItem, isDark && styles12.actionItemDark], children: /* @__PURE__ */ jsx13(Text8, { style: [styles12.actionText, isDark && styles12.actionTextDark], children: "Export" }) })
28550
28723
  ] }),
28551
- /* @__PURE__ */ jsx12(Pressable8, { onPress: onClose, style: styles11.closeButton, accessibilityLabel: "Close actions sheet", children: /* @__PURE__ */ jsx12(Text7, { style: styles11.closeText, children: "Close" }) })
28724
+ /* @__PURE__ */ jsx13(Pressable9, { onPress: onClose, style: styles12.closeButton, accessibilityLabel: "Close actions sheet", children: /* @__PURE__ */ jsx13(Text8, { style: styles12.closeText, children: "Close" }) })
28552
28725
  ]
28553
28726
  }
28554
28727
  ) }) });
28555
28728
  }
28556
- var styles11 = StyleSheet11.create({
28729
+ var styles12 = StyleSheet12.create({
28557
28730
  backdrop: {
28558
28731
  flex: 1,
28559
28732
  backgroundColor: "rgba(15, 23, 42, 0.35)",
@@ -28615,12 +28788,12 @@ var styles11 = StyleSheet11.create({
28615
28788
 
28616
28789
  // components/InfoSheet.tsx
28617
28790
  import {
28618
- Modal as Modal6,
28619
- Pressable as Pressable9,
28620
- ScrollView as ScrollView5,
28621
- StyleSheet as StyleSheet12,
28622
- Text as Text8,
28623
- View as View12
28791
+ Modal as Modal4,
28792
+ Pressable as Pressable10,
28793
+ ScrollView as ScrollView4,
28794
+ StyleSheet as StyleSheet13,
28795
+ Text as Text9,
28796
+ View as View13
28624
28797
  } from "react-native";
28625
28798
  import { useViewerStore as useViewerStore11 } from "@papyrus-sdk/core";
28626
28799
 
@@ -28721,7 +28894,7 @@ var buildInfoRows = ({
28721
28894
  };
28722
28895
 
28723
28896
  // components/InfoSheet.tsx
28724
- import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
28897
+ import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
28725
28898
  function InfoSheet({
28726
28899
  visible,
28727
28900
  title,
@@ -28751,66 +28924,66 @@ function InfoSheet({
28751
28924
  pageTheme,
28752
28925
  locale
28753
28926
  });
28754
- return /* @__PURE__ */ jsx13(
28755
- Modal6,
28927
+ return /* @__PURE__ */ jsx14(
28928
+ Modal4,
28756
28929
  {
28757
28930
  visible,
28758
28931
  transparent: true,
28759
28932
  animationType: "fade",
28760
28933
  onRequestClose: onClose,
28761
- children: /* @__PURE__ */ jsx13(Pressable9, { style: styles12.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs13(
28762
- Pressable9,
28934
+ children: /* @__PURE__ */ jsx14(Pressable10, { style: styles13.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs14(
28935
+ Pressable10,
28763
28936
  {
28764
28937
  onPress: (event) => event.stopPropagation(),
28765
- style: [styles12.card, isDark && styles12.cardDark],
28938
+ style: [styles13.card, isDark && styles13.cardDark],
28766
28939
  children: [
28767
- /* @__PURE__ */ jsxs13(View12, { style: styles12.topRow, children: [
28768
- /* @__PURE__ */ jsx13(
28769
- Pressable9,
28940
+ /* @__PURE__ */ jsxs14(View13, { style: styles13.topRow, children: [
28941
+ /* @__PURE__ */ jsx14(
28942
+ Pressable10,
28770
28943
  {
28771
28944
  onPress: onClose,
28772
28945
  style: [
28773
- styles12.iconCloseButton,
28774
- isDark && styles12.iconCloseButtonDark
28946
+ styles13.iconCloseButton,
28947
+ isDark && styles13.iconCloseButtonDark
28775
28948
  ],
28776
28949
  accessibilityLabel: "Close info sheet",
28777
- children: /* @__PURE__ */ jsx13(IconClose, { size: 18, color: isDark ? "#f8fafc" : "#111827" })
28950
+ children: /* @__PURE__ */ jsx14(IconClose, { size: 18, color: isDark ? "#f8fafc" : "#111827" })
28778
28951
  }
28779
28952
  ),
28780
- /* @__PURE__ */ jsx13(
28781
- Text8,
28953
+ /* @__PURE__ */ jsx14(
28954
+ Text9,
28782
28955
  {
28783
- style: [styles12.headerTitle, isDark && styles12.headerTitleDark],
28956
+ style: [styles13.headerTitle, isDark && styles13.headerTitleDark],
28784
28957
  numberOfLines: 1,
28785
28958
  children: locale === "pt-BR" ? "Informa\xE7\xF5es" : "Information"
28786
28959
  }
28787
28960
  ),
28788
- /* @__PURE__ */ jsx13(View12, { style: styles12.topRowSpacer })
28961
+ /* @__PURE__ */ jsx14(View13, { style: styles13.topRowSpacer })
28789
28962
  ] }),
28790
- /* @__PURE__ */ jsxs13(
28791
- ScrollView5,
28963
+ /* @__PURE__ */ jsxs14(
28964
+ ScrollView4,
28792
28965
  {
28793
- style: styles12.content,
28794
- contentContainerStyle: styles12.contentInner,
28966
+ style: styles13.content,
28967
+ contentContainerStyle: styles13.contentInner,
28795
28968
  showsVerticalScrollIndicator: false,
28796
28969
  children: [
28797
- /* @__PURE__ */ jsx13(
28798
- Text8,
28970
+ /* @__PURE__ */ jsx14(
28971
+ Text9,
28799
28972
  {
28800
- style: [styles12.sectionTitle, isDark && styles12.sectionTitleDark],
28973
+ style: [styles13.sectionTitle, isDark && styles13.sectionTitleDark],
28801
28974
  children: locale === "pt-BR" ? "Informa\xE7\xF5es" : "Information"
28802
28975
  }
28803
28976
  ),
28804
- /* @__PURE__ */ jsx13(View12, { style: styles12.rows, children: rows.map((row) => /* @__PURE__ */ jsxs13(
28805
- View12,
28977
+ /* @__PURE__ */ jsx14(View13, { style: styles13.rows, children: rows.map((row) => /* @__PURE__ */ jsxs14(
28978
+ View13,
28806
28979
  {
28807
- style: [styles12.row, isDark && styles12.rowDark],
28980
+ style: [styles13.row, isDark && styles13.rowDark],
28808
28981
  children: [
28809
- /* @__PURE__ */ jsx13(Text8, { style: [styles12.label, isDark && styles12.labelDark], children: row.label }),
28810
- /* @__PURE__ */ jsx13(
28811
- Text8,
28982
+ /* @__PURE__ */ jsx14(Text9, { style: [styles13.label, isDark && styles13.labelDark], children: row.label }),
28983
+ /* @__PURE__ */ jsx14(
28984
+ Text9,
28812
28985
  {
28813
- style: [styles12.value, isDark && styles12.valueDark],
28986
+ style: [styles13.value, isDark && styles13.valueDark],
28814
28987
  selectable: true,
28815
28988
  children: row.value
28816
28989
  }
@@ -28828,15 +29001,15 @@ function InfoSheet({
28828
29001
  }
28829
29002
  );
28830
29003
  }
28831
- var styles12 = StyleSheet12.create({
29004
+ var styles13 = StyleSheet13.create({
28832
29005
  backdrop: {
28833
29006
  flex: 1,
28834
- backgroundColor: "rgba(15, 23, 42, 0.42)",
29007
+ backgroundColor: "rgba(0, 0, 0, 0.4)",
28835
29008
  justifyContent: "flex-end",
28836
29009
  padding: 16
28837
29010
  },
28838
29011
  card: {
28839
- borderRadius: 34,
29012
+ borderRadius: 24,
28840
29013
  backgroundColor: "#ffffff",
28841
29014
  paddingHorizontal: 16,
28842
29015
  paddingTop: 16,
@@ -28845,7 +29018,7 @@ var styles12 = StyleSheet12.create({
28845
29018
  maxHeight: "88%"
28846
29019
  },
28847
29020
  cardDark: {
28848
- backgroundColor: "#1f1f22"
29021
+ backgroundColor: "#0f1115"
28849
29022
  },
28850
29023
  topRow: {
28851
29024
  flexDirection: "row",
@@ -28866,7 +29039,7 @@ var styles12 = StyleSheet12.create({
28866
29039
  backgroundColor: "#f1f5f9"
28867
29040
  },
28868
29041
  iconCloseButtonDark: {
28869
- backgroundColor: "#2a2a2f"
29042
+ backgroundColor: "#111827"
28870
29043
  },
28871
29044
  headerTitle: {
28872
29045
  fontSize: 18,
@@ -28931,9 +29104,9 @@ var styles12 = StyleSheet12.create({
28931
29104
  });
28932
29105
 
28933
29106
  // components/OverflowSheet.tsx
28934
- import { Modal as Modal7, Pressable as Pressable10, StyleSheet as StyleSheet13, Text as Text9, View as View13 } from "react-native";
29107
+ import { Modal as Modal5, Pressable as Pressable11, StyleSheet as StyleSheet14, Text as Text10, View as View14 } from "react-native";
28935
29108
  import { useViewerStore as useViewerStore12 } from "@papyrus-sdk/core";
28936
- import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
29109
+ import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
28937
29110
  var actionLabels = [{ key: "actions", label: "Document actions" }];
28938
29111
  function OverflowSheet({
28939
29112
  visible,
@@ -28945,30 +29118,30 @@ function OverflowSheet({
28945
29118
  const handlers = {
28946
29119
  actions: onOpenActions
28947
29120
  };
28948
- return /* @__PURE__ */ jsx14(
28949
- Modal7,
29121
+ return /* @__PURE__ */ jsx15(
29122
+ Modal5,
28950
29123
  {
28951
29124
  visible,
28952
29125
  transparent: true,
28953
29126
  animationType: "fade",
28954
29127
  onRequestClose: onClose,
28955
- children: /* @__PURE__ */ jsx14(Pressable10, { style: styles13.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs14(
28956
- Pressable10,
29128
+ children: /* @__PURE__ */ jsx15(Pressable11, { style: styles14.backdrop, onPress: onClose, children: /* @__PURE__ */ jsxs15(
29129
+ Pressable11,
28957
29130
  {
28958
29131
  onPress: (event) => event.stopPropagation(),
28959
- style: [styles13.card, isDark && styles13.cardDark],
29132
+ style: [styles14.card, isDark && styles14.cardDark],
28960
29133
  children: [
28961
- /* @__PURE__ */ jsx14(View13, { style: styles13.handle }),
28962
- actionLabels.map((action) => /* @__PURE__ */ jsx14(
28963
- Pressable10,
29134
+ /* @__PURE__ */ jsx15(View14, { style: styles14.handle }),
29135
+ actionLabels.map((action) => /* @__PURE__ */ jsx15(
29136
+ Pressable11,
28964
29137
  {
28965
29138
  onPress: handlers[action.key],
28966
- style: [styles13.actionButton, { borderColor: accentColor }],
29139
+ style: [styles14.actionButton, { borderColor: accentColor }],
28967
29140
  accessibilityLabel: action.label,
28968
- children: /* @__PURE__ */ jsx14(
28969
- Text9,
29141
+ children: /* @__PURE__ */ jsx15(
29142
+ Text10,
28970
29143
  {
28971
- style: [styles13.actionText, isDark && styles13.actionTextDark],
29144
+ style: [styles14.actionText, isDark && styles14.actionTextDark],
28972
29145
  children: action.label
28973
29146
  }
28974
29147
  )
@@ -28981,7 +29154,7 @@ function OverflowSheet({
28981
29154
  }
28982
29155
  );
28983
29156
  }
28984
- var styles13 = StyleSheet13.create({
29157
+ var styles14 = StyleSheet14.create({
28985
29158
  backdrop: {
28986
29159
  flex: 1,
28987
29160
  backgroundColor: "rgba(15, 23, 42, 0.35)",
@@ -29022,12 +29195,16 @@ var styles13 = StyleSheet13.create({
29022
29195
  });
29023
29196
 
29024
29197
  // components/ProgressPill.tsx
29025
- import { useMemo as useMemo7 } from "react";
29026
- import { Pressable as Pressable11, StyleSheet as StyleSheet14, Text as Text10, View as View14 } from "react-native";
29198
+ import { useMemo as useMemo8 } from "react";
29199
+ import { Pressable as Pressable12, StyleSheet as StyleSheet15, Text as Text11, View as View15 } from "react-native";
29027
29200
  import { useViewerStore as useViewerStore13 } from "@papyrus-sdk/core";
29028
- import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
29201
+ import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
29029
29202
  var clampPercent = (value) => Math.max(0, Math.min(100, Math.round(value)));
29030
- function ProgressPill({ documentType, onPress }) {
29203
+ function ProgressPill({
29204
+ documentType,
29205
+ onPress,
29206
+ onOpenPageJump
29207
+ }) {
29031
29208
  const {
29032
29209
  currentPage,
29033
29210
  pageCount,
@@ -29037,7 +29214,7 @@ function ProgressPill({ documentType, onPress }) {
29037
29214
  mobileProgressPillVisible
29038
29215
  } = useViewerStore13();
29039
29216
  const isDark = uiTheme === "dark";
29040
- const label = useMemo7(() => {
29217
+ const label = useMemo8(() => {
29041
29218
  const total = Math.max(pageCount, 1);
29042
29219
  const percent = clampPercent(currentPage / total * 100);
29043
29220
  if (documentType === "pdf") {
@@ -29049,37 +29226,53 @@ function ProgressPill({ documentType, onPress }) {
29049
29226
  return `${percent}%`;
29050
29227
  }, [currentPage, documentType, pageCount]);
29051
29228
  if (!mobileChromeVisible || !mobileProgressPillVisible) return null;
29052
- return /* @__PURE__ */ jsx15(View14, { pointerEvents: "box-none", style: styles14.frame, children: /* @__PURE__ */ jsxs15(
29053
- Pressable11,
29229
+ return /* @__PURE__ */ jsx16(View15, { pointerEvents: "box-none", style: styles15.frame, children: /* @__PURE__ */ jsxs16(
29230
+ View15,
29054
29231
  {
29055
- onPress,
29056
29232
  accessibilityLabel: "Open document navigation",
29057
29233
  style: [
29058
- styles14.pill,
29059
- isDark && styles14.pillDark,
29234
+ styles15.pill,
29235
+ isDark && styles15.pillDark,
29060
29236
  { borderColor: `${accentColor}33` }
29061
29237
  ],
29062
29238
  testID: "papyrus-progress-pill",
29063
29239
  children: [
29064
- /* @__PURE__ */ jsx15(
29065
- IconPageNav,
29240
+ /* @__PURE__ */ jsx16(
29241
+ Pressable12,
29066
29242
  {
29067
- size: 20,
29068
- color: isDark ? "#f8fafc" : "#111827",
29069
- strokeWidth: 1.8
29243
+ onPress,
29244
+ style: styles15.iconHit,
29245
+ accessibilityLabel: "Open document navigation",
29246
+ children: /* @__PURE__ */ jsx16(
29247
+ IconPageNav,
29248
+ {
29249
+ size: 20,
29250
+ color: isDark ? "#f8fafc" : "#111827",
29251
+ strokeWidth: 1.8
29252
+ }
29253
+ )
29070
29254
  }
29071
29255
  ),
29072
- /* @__PURE__ */ jsx15(Text10, { style: [styles14.label, isDark && styles14.labelDark], children: label })
29256
+ /* @__PURE__ */ jsx16(
29257
+ Pressable12,
29258
+ {
29259
+ onPress,
29260
+ onLongPress: onOpenPageJump,
29261
+ style: styles15.labelHit,
29262
+ accessibilityLabel: "Open page jump",
29263
+ children: /* @__PURE__ */ jsx16(Text11, { style: [styles15.label, isDark && styles15.labelDark], children: label })
29264
+ }
29265
+ )
29073
29266
  ]
29074
29267
  }
29075
29268
  ) });
29076
29269
  }
29077
- var styles14 = StyleSheet14.create({
29270
+ var styles15 = StyleSheet15.create({
29078
29271
  frame: {
29079
29272
  position: "absolute",
29080
29273
  top: 72,
29081
- left: 12,
29082
- right: 12,
29274
+ left: MOBILE_CHROME_METRICS.screenPadding,
29275
+ right: MOBILE_CHROME_METRICS.screenPadding,
29083
29276
  bottom: "auto",
29084
29277
  alignItems: "flex-start",
29085
29278
  zIndex: 18
@@ -29101,6 +29294,12 @@ var styles14 = StyleSheet14.create({
29101
29294
  shadowOffset: { width: 0, height: 8 },
29102
29295
  elevation: 6
29103
29296
  },
29297
+ iconHit: {
29298
+ borderRadius: 8
29299
+ },
29300
+ labelHit: {
29301
+ borderRadius: 8
29302
+ },
29104
29303
  pillDark: {
29105
29304
  backgroundColor: "rgba(15,17,21,0.88)"
29106
29305
  },
@@ -29116,17 +29315,17 @@ var styles14 = StyleSheet14.create({
29116
29315
  });
29117
29316
 
29118
29317
  // components/SearchOverlay.tsx
29119
- import { useEffect as useEffect9, useMemo as useMemo8, useState as useState8 } from "react";
29318
+ import { useEffect as useEffect9, useMemo as useMemo9, useState as useState9 } from "react";
29120
29319
  import {
29121
29320
  Keyboard,
29122
- Pressable as Pressable12,
29123
- StyleSheet as StyleSheet15,
29124
- Text as Text11,
29321
+ Pressable as Pressable13,
29322
+ StyleSheet as StyleSheet16,
29323
+ Text as Text12,
29125
29324
  TextInput as TextInput3,
29126
- View as View15
29325
+ View as View16
29127
29326
  } from "react-native";
29128
29327
  import { SearchService, useViewerStore as useViewerStore14 } from "@papyrus-sdk/core";
29129
- import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
29328
+ import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
29130
29329
  function SearchOverlay({
29131
29330
  engine,
29132
29331
  documentType,
@@ -29145,11 +29344,11 @@ function SearchOverlay({
29145
29344
  uiTheme,
29146
29345
  accentColor
29147
29346
  } = useViewerStore14();
29148
- const [draft, setDraft] = useState8(searchQuery);
29149
- const [isSearching, setIsSearching] = useState8(false);
29347
+ const [draft, setDraft] = useState9(searchQuery);
29348
+ const [isSearching, setIsSearching] = useState9(false);
29150
29349
  const isDark = uiTheme === "dark";
29151
29350
  const t = getStrings(locale);
29152
- const searchService = useMemo8(() => new SearchService(engine), [engine]);
29351
+ const searchService = useMemo9(() => new SearchService(engine), [engine]);
29153
29352
  const currentCount = searchResults.length > 0 && activeSearchIndex >= 0 ? activeSearchIndex + 1 : 0;
29154
29353
  const targetLabel = documentType === "pdf" ? t.page : documentType === "epub" ? t.contents : t.progress;
29155
29354
  useEffect9(() => {
@@ -29175,23 +29374,23 @@ function SearchOverlay({
29175
29374
  onClose();
29176
29375
  };
29177
29376
  if (!visible) return null;
29178
- return /* @__PURE__ */ jsx16(View15, { pointerEvents: "box-none", style: styles15.frame, children: /* @__PURE__ */ jsxs16(
29179
- View15,
29377
+ return /* @__PURE__ */ jsx17(View16, { pointerEvents: "box-none", style: styles16.frame, children: /* @__PURE__ */ jsxs17(
29378
+ View16,
29180
29379
  {
29181
- style: [styles15.card, isDark && styles15.cardDark],
29380
+ style: [styles16.card, isDark && styles16.cardDark],
29182
29381
  testID: "papyrus-search-overlay",
29183
29382
  children: [
29184
- /* @__PURE__ */ jsxs16(View15, { style: styles15.inputRow, children: [
29185
- /* @__PURE__ */ jsxs16(View15, { style: [styles15.searchInputWrap, isDark && styles15.searchInputWrapDark], children: [
29186
- /* @__PURE__ */ jsx16(IconSearch, { size: 16, color: isDark ? "#cbd5e1" : "#64748b" }),
29187
- /* @__PURE__ */ jsx16(
29383
+ /* @__PURE__ */ jsxs17(View16, { style: styles16.inputRow, children: [
29384
+ /* @__PURE__ */ jsxs17(View16, { style: [styles16.searchInputWrap, isDark && styles16.searchInputWrapDark], children: [
29385
+ /* @__PURE__ */ jsx17(IconSearch, { size: 16, color: isDark ? "#cbd5e1" : "#64748b" }),
29386
+ /* @__PURE__ */ jsx17(
29188
29387
  TextInput3,
29189
29388
  {
29190
29389
  value: draft,
29191
29390
  onChangeText: setDraft,
29192
29391
  placeholder: t.searchPlaceholder,
29193
29392
  placeholderTextColor: isDark ? "#94a3b8" : "#6b7280",
29194
- style: [styles15.input, isDark && styles15.inputDark],
29393
+ style: [styles16.input, isDark && styles16.inputDark],
29195
29394
  autoFocus: true,
29196
29395
  returnKeyType: "search",
29197
29396
  onSubmitEditing: handleSubmit,
@@ -29199,74 +29398,74 @@ function SearchOverlay({
29199
29398
  }
29200
29399
  )
29201
29400
  ] }),
29202
- /* @__PURE__ */ jsx16(
29203
- Pressable12,
29401
+ /* @__PURE__ */ jsx17(
29402
+ Pressable13,
29204
29403
  {
29205
29404
  onPress: handleClose,
29206
- style: [styles15.closeButton, isDark && styles15.closeButtonDark],
29405
+ style: [styles16.closeButton, isDark && styles16.closeButtonDark],
29207
29406
  accessibilityLabel: "Close search",
29208
- children: /* @__PURE__ */ jsx16(Text11, { style: [styles15.closeText, isDark && styles15.closeTextDark], children: t.cancel })
29407
+ children: /* @__PURE__ */ jsx17(Text12, { style: [styles16.closeText, isDark && styles16.closeTextDark], children: t.cancel })
29209
29408
  }
29210
29409
  )
29211
29410
  ] }),
29212
- /* @__PURE__ */ jsxs16(View15, { style: styles15.metaRow, children: [
29213
- /* @__PURE__ */ jsx16(
29214
- Pressable12,
29411
+ /* @__PURE__ */ jsxs17(View16, { style: styles16.metaRow, children: [
29412
+ /* @__PURE__ */ jsx17(
29413
+ Pressable13,
29215
29414
  {
29216
29415
  onPress: prevSearchResult,
29217
29416
  disabled: searchResults.length === 0,
29218
29417
  style: [
29219
- styles15.navButton,
29220
- isDark && styles15.navButtonDark,
29221
- searchResults.length === 0 && styles15.navButtonDisabled
29418
+ styles16.navButton,
29419
+ isDark && styles16.navButtonDark,
29420
+ searchResults.length === 0 && styles16.navButtonDisabled
29222
29421
  ],
29223
29422
  accessibilityLabel: "Previous result",
29224
- children: /* @__PURE__ */ jsx16(IconChevronLeft, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
29423
+ children: /* @__PURE__ */ jsx17(IconChevronLeft, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
29225
29424
  }
29226
29425
  ),
29227
- /* @__PURE__ */ jsx16(Text11, { style: [styles15.metaText, isDark && styles15.metaTextDark], children: isSearching ? t.searching : `${currentCount}/${searchResults.length} ${targetLabel}` }),
29228
- /* @__PURE__ */ jsx16(
29229
- Pressable12,
29426
+ /* @__PURE__ */ jsx17(Text12, { style: [styles16.metaText, isDark && styles16.metaTextDark], children: isSearching ? t.searching : `${currentCount}/${searchResults.length} ${targetLabel}` }),
29427
+ /* @__PURE__ */ jsx17(
29428
+ Pressable13,
29230
29429
  {
29231
29430
  onPress: nextSearchResult,
29232
29431
  disabled: searchResults.length === 0,
29233
29432
  style: [
29234
- styles15.navButton,
29235
- isDark && styles15.navButtonDark,
29236
- searchResults.length === 0 && styles15.navButtonDisabled
29433
+ styles16.navButton,
29434
+ isDark && styles16.navButtonDark,
29435
+ searchResults.length === 0 && styles16.navButtonDisabled
29237
29436
  ],
29238
29437
  accessibilityLabel: "Next result",
29239
- children: /* @__PURE__ */ jsx16(IconChevronRight, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
29438
+ children: /* @__PURE__ */ jsx17(IconChevronRight, { size: 16, color: isDark ? "#e5e7eb" : "#111827" })
29240
29439
  }
29241
29440
  )
29242
29441
  ] }),
29243
- /* @__PURE__ */ jsxs16(View15, { style: styles15.actionsRow, children: [
29244
- /* @__PURE__ */ jsx16(
29245
- Pressable12,
29442
+ /* @__PURE__ */ jsxs17(View16, { style: styles16.actionsRow, children: [
29443
+ /* @__PURE__ */ jsx17(
29444
+ Pressable13,
29246
29445
  {
29247
29446
  onPress: handleSubmit,
29248
- style: [styles15.primaryAction, { backgroundColor: accentColor }],
29447
+ style: [styles16.primaryAction, { backgroundColor: accentColor }],
29249
29448
  accessibilityLabel: "Run search",
29250
- children: /* @__PURE__ */ jsx16(Text11, { style: styles15.primaryActionText, children: t.searchGo })
29449
+ children: /* @__PURE__ */ jsx17(Text12, { style: styles16.primaryActionText, children: t.searchGo })
29251
29450
  }
29252
29451
  ),
29253
- /* @__PURE__ */ jsx16(
29254
- Pressable12,
29452
+ /* @__PURE__ */ jsx17(
29453
+ Pressable13,
29255
29454
  {
29256
29455
  onPress: onOpenResults,
29257
29456
  disabled: searchResults.length === 0,
29258
29457
  style: [
29259
- styles15.secondaryAction,
29260
- isDark && styles15.secondaryActionDark,
29261
- searchResults.length === 0 && styles15.navButtonDisabled
29458
+ styles16.secondaryAction,
29459
+ isDark && styles16.secondaryActionDark,
29460
+ searchResults.length === 0 && styles16.navButtonDisabled
29262
29461
  ],
29263
29462
  accessibilityLabel: "Open all results",
29264
- children: /* @__PURE__ */ jsx16(
29265
- Text11,
29463
+ children: /* @__PURE__ */ jsx17(
29464
+ Text12,
29266
29465
  {
29267
29466
  style: [
29268
- styles15.secondaryActionText,
29269
- isDark && styles15.secondaryActionTextDark
29467
+ styles16.secondaryActionText,
29468
+ isDark && styles16.secondaryActionTextDark
29270
29469
  ],
29271
29470
  children: t.allResults
29272
29471
  }
@@ -29278,7 +29477,7 @@ function SearchOverlay({
29278
29477
  }
29279
29478
  ) });
29280
29479
  }
29281
- var styles15 = StyleSheet15.create({
29480
+ var styles16 = StyleSheet16.create({
29282
29481
  frame: {
29283
29482
  position: "absolute",
29284
29483
  left: 0,
@@ -29420,15 +29619,15 @@ var styles15 = StyleSheet15.create({
29420
29619
 
29421
29620
  // components/SearchResultsSheet.tsx
29422
29621
  import {
29423
- Modal as Modal8,
29424
- Pressable as Pressable13,
29425
- ScrollView as ScrollView6,
29426
- StyleSheet as StyleSheet16,
29427
- Text as Text12,
29428
- View as View16
29622
+ Modal as Modal6,
29623
+ Pressable as Pressable14,
29624
+ ScrollView as ScrollView5,
29625
+ StyleSheet as StyleSheet17,
29626
+ Text as Text13,
29627
+ View as View17
29429
29628
  } from "react-native";
29430
29629
  import { useViewerStore as useViewerStore15 } from "@papyrus-sdk/core";
29431
- import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
29630
+ import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
29432
29631
  function SearchResultsSheet({
29433
29632
  documentType,
29434
29633
  visible,
@@ -29452,29 +29651,29 @@ function SearchResultsSheet({
29452
29651
  const percent = pageCount <= 1 ? 100 : Math.round((pageIndex + 1) / pageCount * 100);
29453
29652
  return `${t.progress} ${percent}%`;
29454
29653
  };
29455
- return /* @__PURE__ */ jsx17(
29456
- Modal8,
29654
+ return /* @__PURE__ */ jsx18(
29655
+ Modal6,
29457
29656
  {
29458
29657
  visible,
29459
29658
  transparent: true,
29460
29659
  animationType: "slide",
29461
29660
  onRequestClose: onClose,
29462
- children: /* @__PURE__ */ jsxs17(View16, { style: styles16.modalRoot, children: [
29463
- /* @__PURE__ */ jsx17(Pressable13, { style: styles16.backdrop, onPress: onClose }),
29464
- /* @__PURE__ */ jsxs17(View16, { style: [styles16.sheet, isDark && styles16.sheetDark], children: [
29465
- /* @__PURE__ */ jsx17(View16, { style: [styles16.handle, isDark && styles16.handleDark] }),
29466
- /* @__PURE__ */ jsxs17(View16, { style: styles16.header, children: [
29467
- /* @__PURE__ */ jsx17(Text12, { style: [styles16.title, isDark && styles16.titleDark], children: t.allResults }),
29468
- /* @__PURE__ */ jsxs17(Text12, { style: [styles16.meta, isDark && styles16.metaDark], children: [
29661
+ children: /* @__PURE__ */ jsxs18(View17, { style: styles17.modalRoot, children: [
29662
+ /* @__PURE__ */ jsx18(Pressable14, { style: styles17.backdrop, onPress: onClose }),
29663
+ /* @__PURE__ */ jsxs18(View17, { style: [styles17.sheet, isDark && styles17.sheetDark], children: [
29664
+ /* @__PURE__ */ jsx18(View17, { style: [styles17.handle, isDark && styles17.handleDark] }),
29665
+ /* @__PURE__ */ jsxs18(View17, { style: styles17.header, children: [
29666
+ /* @__PURE__ */ jsx18(Text13, { style: [styles17.title, isDark && styles17.titleDark], children: t.allResults }),
29667
+ /* @__PURE__ */ jsxs18(Text13, { style: [styles17.meta, isDark && styles17.metaDark], children: [
29469
29668
  searchResults.length,
29470
29669
  " ",
29471
29670
  t.results
29472
29671
  ] })
29473
29672
  ] }),
29474
- /* @__PURE__ */ jsx17(ScrollView6, { contentContainerStyle: styles16.content, children: searchResults.length === 0 ? /* @__PURE__ */ jsx17(Text12, { style: [styles16.emptyText, isDark && styles16.emptyTextDark], children: t.noResults }) : searchResults.map((result, index) => {
29673
+ /* @__PURE__ */ jsx18(ScrollView5, { contentContainerStyle: styles17.content, children: searchResults.length === 0 ? /* @__PURE__ */ jsx18(Text13, { style: [styles17.emptyText, isDark && styles17.emptyTextDark], children: t.noResults }) : searchResults.map((result, index) => {
29475
29674
  const isActive = index === activeSearchIndex;
29476
- return /* @__PURE__ */ jsxs17(
29477
- Pressable13,
29675
+ return /* @__PURE__ */ jsxs18(
29676
+ Pressable14,
29478
29677
  {
29479
29678
  onPress: () => {
29480
29679
  setDocumentState({
@@ -29485,21 +29684,21 @@ function SearchResultsSheet({
29485
29684
  onClose();
29486
29685
  },
29487
29686
  style: [
29488
- styles16.resultCard,
29489
- isDark && styles16.resultCardDark,
29687
+ styles17.resultCard,
29688
+ isDark && styles17.resultCardDark,
29490
29689
  isActive && {
29491
29690
  borderColor: accentColor,
29492
29691
  backgroundColor: `${accentColor}14`
29493
29692
  }
29494
29693
  ],
29495
29694
  children: [
29496
- /* @__PURE__ */ jsx17(Text12, { style: [styles16.resultLabel, { color: accentColor }], children: getResultLabel(result.pageIndex) }),
29497
- /* @__PURE__ */ jsx17(
29498
- Text12,
29695
+ /* @__PURE__ */ jsx18(Text13, { style: [styles17.resultLabel, { color: accentColor }], children: getResultLabel(result.pageIndex) }),
29696
+ /* @__PURE__ */ jsx18(
29697
+ Text13,
29499
29698
  {
29500
29699
  style: [
29501
- styles16.resultText,
29502
- isDark && styles16.resultTextDark
29700
+ styles17.resultText,
29701
+ isDark && styles17.resultTextDark
29503
29702
  ],
29504
29703
  children: result.text
29505
29704
  }
@@ -29514,13 +29713,13 @@ function SearchResultsSheet({
29514
29713
  }
29515
29714
  );
29516
29715
  }
29517
- var styles16 = StyleSheet16.create({
29716
+ var styles17 = StyleSheet17.create({
29518
29717
  modalRoot: {
29519
29718
  flex: 1,
29520
29719
  backgroundColor: "transparent"
29521
29720
  },
29522
29721
  backdrop: {
29523
- ...StyleSheet16.absoluteFillObject,
29722
+ ...StyleSheet17.absoluteFillObject,
29524
29723
  backgroundColor: "rgba(0, 0, 0, 0.4)"
29525
29724
  },
29526
29725
  sheet: {
@@ -29615,7 +29814,7 @@ var styles16 = StyleSheet16.create({
29615
29814
  var isSidebarBoundDestination = (destination) => destination === "pages" || destination === "contents" || destination === "progress" || destination === "notes";
29616
29815
 
29617
29816
  // components/ReadingShell.tsx
29618
- import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
29817
+ import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
29619
29818
  function ReadingShell({
29620
29819
  engine,
29621
29820
  title,
@@ -29629,14 +29828,21 @@ function ReadingShell({
29629
29828
  openMobileDestination,
29630
29829
  setDocumentState,
29631
29830
  setMobileKeyboardOpen,
29632
- sidebarRightOpen
29831
+ triggerScrollToPage,
29832
+ sidebarRightOpen,
29833
+ currentPage,
29834
+ pageCount,
29835
+ uiTheme,
29836
+ accentColor
29633
29837
  } = useViewerStore16();
29634
- const [overflowOpen, setOverflowOpen] = useState9(false);
29635
- const [infoOpen, setInfoOpen] = useState9(false);
29636
- const [actionsOpen, setActionsOpen] = useState9(false);
29637
- const [settingsOpen, setSettingsOpen] = useState9(false);
29638
- const [searchResultsOpen, setSearchResultsOpen] = useState9(false);
29639
- React11.useEffect(() => {
29838
+ const [overflowOpen, setOverflowOpen] = useState10(false);
29839
+ const [infoOpen, setInfoOpen] = useState10(false);
29840
+ const [actionsOpen, setActionsOpen] = useState10(false);
29841
+ const [settingsOpen, setSettingsOpen] = useState10(false);
29842
+ const [searchResultsOpen, setSearchResultsOpen] = useState10(false);
29843
+ const [pageJumpOpen, setPageJumpOpen] = useState10(false);
29844
+ const isDark = uiTheme === "dark";
29845
+ React13.useEffect(() => {
29640
29846
  const showSubscription = Keyboard2.addListener("keyboardDidShow", () => {
29641
29847
  setMobileKeyboardOpen(true);
29642
29848
  });
@@ -29648,7 +29854,7 @@ function ReadingShell({
29648
29854
  hideSubscription.remove();
29649
29855
  };
29650
29856
  }, [setMobileKeyboardOpen]);
29651
- React11.useEffect(() => {
29857
+ React13.useEffect(() => {
29652
29858
  if (sidebarRightOpen) return;
29653
29859
  if (isSidebarBoundDestination(activeMobileDestination)) {
29654
29860
  closeMobileDestination();
@@ -29689,8 +29895,13 @@ function ReadingShell({
29689
29895
  setActionsOpen(true);
29690
29896
  }
29691
29897
  };
29692
- return /* @__PURE__ */ jsxs18(View17, { style: styles17.container, testID: "papyrus-rn-reading-shell", children: [
29693
- /* @__PURE__ */ jsx18(
29898
+ const navigateToPage = (page) => {
29899
+ engine.goToPage(page);
29900
+ setDocumentState({ currentPage: page });
29901
+ triggerScrollToPage(page - 1);
29902
+ };
29903
+ return /* @__PURE__ */ jsxs19(View18, { style: styles18.container, testID: "papyrus-rn-reading-shell", children: [
29904
+ /* @__PURE__ */ jsx19(
29694
29905
  Topbar_default,
29695
29906
  {
29696
29907
  engine,
@@ -29702,20 +29913,22 @@ function ReadingShell({
29702
29913
  setSettingsOpen(false);
29703
29914
  setOverflowOpen(true);
29704
29915
  },
29916
+ onOpenPageJump: () => setPageJumpOpen(true),
29705
29917
  showPageNavigationControls: false
29706
29918
  }
29707
29919
  ),
29708
- /* @__PURE__ */ jsx18(View17, { style: styles17.viewerStage, children: /* @__PURE__ */ jsx18(Viewer_default, { engine, ...viewerProps }) }),
29709
- /* @__PURE__ */ jsx18(
29920
+ /* @__PURE__ */ jsx19(View18, { style: styles18.viewerStage, children: /* @__PURE__ */ jsx19(Viewer_default, { engine, ...viewerProps }) }),
29921
+ /* @__PURE__ */ jsx19(
29710
29922
  ProgressPill,
29711
29923
  {
29712
29924
  documentType,
29713
29925
  onPress: () => openDestination(
29714
29926
  documentType === "pdf" ? "pages" : documentType === "epub" ? "contents" : "progress"
29715
- )
29927
+ ),
29928
+ onOpenPageJump: () => setPageJumpOpen(true)
29716
29929
  }
29717
29930
  ),
29718
- /* @__PURE__ */ jsx18(
29931
+ /* @__PURE__ */ jsx19(
29719
29932
  BottomBar_default,
29720
29933
  {
29721
29934
  documentType,
@@ -29724,7 +29937,7 @@ function ReadingShell({
29724
29937
  onOpenSettings: () => openDestination("display")
29725
29938
  }
29726
29939
  ),
29727
- /* @__PURE__ */ jsx18(
29940
+ /* @__PURE__ */ jsx19(
29728
29941
  SearchOverlay,
29729
29942
  {
29730
29943
  engine,
@@ -29737,7 +29950,7 @@ function ReadingShell({
29737
29950
  onOpenResults: () => setSearchResultsOpen(true)
29738
29951
  }
29739
29952
  ),
29740
- /* @__PURE__ */ jsx18(
29953
+ /* @__PURE__ */ jsx19(
29741
29954
  SearchResultsSheet,
29742
29955
  {
29743
29956
  documentType,
@@ -29745,15 +29958,16 @@ function ReadingShell({
29745
29958
  onClose: () => setSearchResultsOpen(false)
29746
29959
  }
29747
29960
  ),
29748
- /* @__PURE__ */ jsx18(
29961
+ /* @__PURE__ */ jsx19(
29749
29962
  RightSheet_default,
29750
29963
  {
29751
29964
  engine,
29752
29965
  documentType,
29753
- thumbsInitialCount
29966
+ thumbsInitialCount,
29967
+ onOpenPageJump: () => setPageJumpOpen(true)
29754
29968
  }
29755
29969
  ),
29756
- /* @__PURE__ */ jsx18(
29970
+ /* @__PURE__ */ jsx19(
29757
29971
  OverflowSheet,
29758
29972
  {
29759
29973
  visible: overflowOpen,
@@ -29767,7 +29981,7 @@ function ReadingShell({
29767
29981
  }
29768
29982
  }
29769
29983
  ),
29770
- /* @__PURE__ */ jsx18(
29984
+ /* @__PURE__ */ jsx19(
29771
29985
  InfoSheet,
29772
29986
  {
29773
29987
  visible: infoOpen,
@@ -29779,7 +29993,7 @@ function ReadingShell({
29779
29993
  }
29780
29994
  }
29781
29995
  ),
29782
- /* @__PURE__ */ jsx18(
29996
+ /* @__PURE__ */ jsx19(
29783
29997
  DocumentActionsSheet,
29784
29998
  {
29785
29999
  visible: actionsOpen,
@@ -29789,7 +30003,7 @@ function ReadingShell({
29789
30003
  }
29790
30004
  }
29791
30005
  ),
29792
- /* @__PURE__ */ jsx18(
30006
+ /* @__PURE__ */ jsx19(
29793
30007
  SettingsSheet_default,
29794
30008
  {
29795
30009
  engine,
@@ -29799,10 +30013,22 @@ function ReadingShell({
29799
30013
  closeMobileDestination();
29800
30014
  }
29801
30015
  }
30016
+ ),
30017
+ /* @__PURE__ */ jsx19(
30018
+ PageJumpModal,
30019
+ {
30020
+ visible: pageJumpOpen,
30021
+ currentPage,
30022
+ pageCount,
30023
+ isDark,
30024
+ accentColor,
30025
+ onClose: () => setPageJumpOpen(false),
30026
+ onConfirm: navigateToPage
30027
+ }
29802
30028
  )
29803
30029
  ] });
29804
30030
  }
29805
- var styles17 = StyleSheet17.create({
30031
+ var styles18 = StyleSheet18.create({
29806
30032
  container: {
29807
30033
  flex: 1
29808
30034
  },
@@ -29817,6 +30043,7 @@ export {
29817
30043
  CoverPreview_default as CoverPreview,
29818
30044
  DocumentActionsSheet,
29819
30045
  InfoSheet,
30046
+ MOBILE_CHROME_METRICS,
29820
30047
  OverflowSheet,
29821
30048
  PageRenderer_default as PageRenderer,
29822
30049
  ProgressPill,