Skip to content

Open-source Android PDF and document toolkit with PDF tools, Office viewing, XLSX editing, scanning, and image editing. Built with Kotlin and Jetpack Compose.

Page bar, links everywhere, tidier tools; alpha.9

chethan61628f88f77e5e1
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/AppViewModel.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/AppViewModel.kt
index 4eeca3d..868706a 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/AppViewModel.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/AppViewModel.kt
@@ -514,6 +514,16 @@ class AppViewModel(app: Application, private val saved: SavedStateHandle) : Andr
return true
}
+ /** Follow [uri] from anywhere in the app: mail and phone straight away, a web page after asking. */
+ fun openLink(uri: String) {
+ val parsed = Uri.parse(uri.trim())
+ when (parsed.scheme?.lowercase()) {
+ "mailto", "tel" -> intents.trySend(Intent(Intent.ACTION_VIEW, parsed))
+ "http", "https" -> linkPrompt = uri.trim()
+ else -> tell(text(R.string.msg_link_not_followed))
+ }
+ }
+
/** A web address waiting for "Open web page?". */
var linkPrompt by mutableStateOf<String?>(null)
private set
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt
index 46bb098..4bc59ea 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/Common.kt
@@ -102,7 +102,9 @@ object ToolCatalog {
val PdfToText = ToolDef("pdf2text", LucideIcons.FileText, R.string.tool_pdf_to_text, R.string.home_about_pdf_to_text, Candy.Lemon, setOf("Convert")) { it.toolForFile(FileTool.ToText) }
val FindFields = ToolDef("fields", LucideIcons.ScanText, R.string.tool_find_fields, R.string.home_about_find_fields, Candy.Bubblegum, setOf("Edit")) { it.toolForFile(FileTool.FindFields) }
- val All = listOf(Edit, FillSign, Scan, Combine, Comment, ReadAloud, Organize, Compress, Export, Crop, Protect, Create, TextToPdf, PdfToText, FindFields, EditPhoto)
+ // Text to PDF is a way of Create PDF, and finding a form's fields a part of Fill & Sign: neither
+ // is a tile of its own
+ val All = listOf(Edit, FillSign, Scan, Combine, Comment, ReadAloud, Organize, Compress, Export, Crop, Protect, Create, PdfToText, EditPhoto)
}
/**
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/ToolsScreen.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/ToolsScreen.kt
index c62522a..0ebdc05 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/ToolsScreen.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/desk/ToolsScreen.kt
@@ -86,6 +86,10 @@ private fun toneOf(t: ToolDef): Tone = when (t.key) {
"crop" -> Tone.Sky
"protect" -> Tone.Sage
"create" -> Tone.Butter
+ "pdf2text" -> Tone.Blush
+ "photo" -> Tone.Lavender
+ "text2pdf" -> Tone.Sky
+ "fields" -> Tone.Peach
else -> Tone.Paper
}
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/sheets/SheetViewer.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/sheets/SheetViewer.kt
index 081e3cd..8e1a13e 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/sheets/SheetViewer.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/sheets/SheetViewer.kt
@@ -318,6 +318,35 @@ class SheetGridState internal constructor(private val eng: Engine, private val d
blocks[key] = cells
}
+ /** The hyperlink of the cell at [row], [col], from the cells fetched so far. */
+ fun linkAt(row: Int, col: Int): String? {
+ for (cells in blocks.values) for (c in cells) if (c.row == row && c.col == col) return c.v.link
+ return null
+ }
+
+ /**
+ * Follow a link to a place in this workbook (`Sheet2!B4`, `#'My sheet'!A1`, or just `C7`): that
+ * sheet shown with the cell chosen. False when [target] is not such a place.
+ */
+ fun goTo(target: String): Boolean {
+ val t = target.trim().removePrefix("#")
+ val bang = t.lastIndexOf('!')
+ val sheetName = if (bang > 0) t.substring(0, bang).trim().removeSurrounding("'") else null
+ val ref = (if (bang >= 0) t.substring(bang + 1) else t).replace("$", "").substringBefore(':').trim().uppercase()
+ val m = Regex("""^([A-Z]{1,3})(\d{1,7})$""").matchEntire(ref) ?: return false
+ var col = 0
+ for (ch in m.groupValues[1]) col = col * 26 + (ch - 'A' + 1)
+ val row = m.groupValues[2].toInt() - 1
+ val index = if (sheetName == null) current else sheets.indexOfFirst { it.name.equals(sheetName, ignoreCase = true) }
+ if (index < 0 || row < 0) return false
+ show(index)
+ val span = CellSpan(row.toUInt(), (col - 1).toUInt(), row.toUInt(), (col - 1).toUInt())
+ // brought into view and chosen once the sheet is laid out, as a search hit is
+ hits = listOf(span)
+ hit = 0
+ return true
+ }
+
/**
* After an edit: the layout and cells are fetched again (sizes and values may all have moved).
* What is shown stays until the new layout is in, so the grid doesn't blink empty on every edit.
@@ -727,6 +756,21 @@ fun SheetViewer(vm: AppViewModel, doc: OpenDocument) {
Box(Modifier.padding(4.dp).glassBar(surface = Candy.Sky.copy(alpha = 0.22f)).padding(horizontal = 10.dp, vertical = 6.dp)) {
Text(columnName(cell.col0.toInt()) + (cell.row0.toInt() + 1), style = ClearType.Label, color = LocalGlassInk.current)
}
+ // the cell's hyperlink, one tap away (a place in the workbook, or a web or mail address)
+ val link = if (editing) null else grid.linkAt(cell.row0.toInt(), cell.col0.toInt())
+ if (link != null) {
+ Box(
+ Modifier.padding(end = 4.dp).height(36.dp).clip(Capsule).background(Candy.Sky)
+ .pressable({ if (!grid.goTo(link)) vm.openLink(link) }).padding(horizontal = 12.dp),
+ contentAlignment = Alignment.Center,
+ ) {
+ Row(verticalAlignment = Alignment.CenterVertically) {
+ Icon(LucideIcons.ExternalLink, null, tint = Color.White, modifier = Modifier.size(15.dp))
+ Spacer(Modifier.size(5.dp))
+ Text(stringResource(R.string.sheet_open_link), style = ClearType.Label, color = Color.White, maxLines = 1)
+ }
+ }
+ }
if (editing) {
val focus = remember { androidx.compose.ui.focus.FocusRequester() }
LaunchedEffect(Unit) { focus.requestFocus() }
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/FillSign.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/FillSign.kt
index 5745b6d..9ee7f35 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/FillSign.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/FillSign.kt
@@ -140,6 +140,8 @@ fun FillSignToolbar(vm: AppViewModel, doc: OpenDocument) {
SubDot(stringResource(R.string.fill_add_dot), sel == FillElement.Dot) { vm.fillElement = FillElement.Dot }
SubTool(LucideIcons.RectangleHorizontal, stringResource(R.string.fill_add_box), sel == FillElement.Box, { vm.fillElement = FillElement.Box })
SubTool(LucideIcons.Minus, stringResource(R.string.fill_add_line), sel == FillElement.Line, { vm.fillElement = FillElement.Line })
+ // a form that is only drawn: its lines and boxes are made into fields to tap and fill
+ SubTool(LucideIcons.ScanText, stringResource(R.string.tool_find_fields), false, { vm.detectFields(doc) })
}
SubTool(LucideIcons.Signature, stringResource(R.string.fill_sign_or_initials), sel == FillElement.Signature || sel == FillElement.Initials || doc.controller.signPanel, { doc.controller.signPanel = true })
}
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/QuickTools.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/QuickTools.kt
index e2cdc66..b08b1f2 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/QuickTools.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/QuickTools.kt
@@ -88,7 +88,6 @@ enum class QuickTool(val id: String, @StringRes val label: Int, @StringRes val t
Text("text", R.string.toolbar_label_add_text, R.string.toolbar_tool_text, LucideIcons.Type, ToolHues.text),
Scan("scan", R.string.common_tool_scan, R.string.common_tool_scan, LucideIcons.Camera, ToolHues.scan),
ReadAloud("readaloud", R.string.common_tool_read_aloud, R.string.common_tool_read_aloud, LucideIcons.Volume2, ToolHues.read),
- FindFields("findfields", R.string.toolbar_label_find_fields, R.string.tool_find_fields, LucideIcons.ScanText, ToolHues.sign),
// office documents' own tools (their engines: WordCraft, DeckCraft)
Present("present", R.string.office_present, R.string.office_present, LucideIcons.Presentation, ToolHues.read),
@@ -178,7 +177,6 @@ fun AppViewModel.runQuickTool(doc: OpenDocument, tool: QuickTool) {
}
QuickTool.Crop -> openCrop(doc)
QuickTool.Ocr -> recognizeText(doc)
- QuickTool.FindFields -> detectFields(doc)
QuickTool.Create -> openCreate()
QuickTool.Scan -> startScan()
QuickTool.ReadAloud -> startReadAloud(doc)
diff --git a/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/ViewerOverlays.kt b/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/ViewerOverlays.kt
index 8b0ddc8..d728b8b 100644
--- a/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/ViewerOverlays.kt
+++ b/android/app/src/main/java/com/chethan616/clearpdf/ui/viewer/ViewerOverlays.kt
@@ -6,6 +6,8 @@ import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
+import androidx.compose.foundation.gestures.awaitEachGesture
+import androidx.compose.foundation.gestures.awaitFirstDown
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Arrangement
@@ -66,6 +68,8 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.chethan616.clearpdf.ui.glass.pressable
import com.chethan616.clearpdf.ui.glass.glass
+import com.chethan616.clearpdf.ui.glass.glassBar
+import androidx.compose.foundation.layout.fillMaxHeight
import com.kyant.backdrop.floatingLayer
import com.chethan616.clearpdf.ui.theme.clear
import com.chethan616.clearpdf.R
@@ -453,49 +457,93 @@ fun BoxScope.SelectionHandles(doc: OpenDocument, sel: Selection) {
}
}
-/** Single page mode's scrubber: a pill with the page number along the bottom; drag to go through the pages. */
+/**
+ * Single page mode's page bar, along the bottom over the pages: a glass capsule holding the page
+ * number (a tap opens Go to page) and a track. A tap anywhere on the track goes to that page and a
+ * drag runs through the pages under the finger, a light tick at each. The track reads the page from
+ * the viewer itself on every touch: the old pill kept the place it had when it was first drawn, so
+ * each drag began again from page 1.
+ */
@Composable
fun BoxScope.HorizontalScrubber(doc: OpenDocument, visible: Boolean, bottom: Dp, onDrag: () -> Unit, onTap: () -> Unit) {
- val c = pdfColors
val v = doc.viewer
- val density = LocalDensity.current
var dragging by remember { mutableStateOf(false) }
- var dragX by remember { mutableFloatStateOf(0f) }
+ val feel = com.chethan616.clearpdf.ui.glass.rememberFeel()
+ val latestDrag by androidx.compose.runtime.rememberUpdatedState(onDrag)
+ val count = doc.pageCount
+ val page = v.currentPage
+ val pageOf = stringResource(R.string.viewer_page_of, page + 1, count)
AnimatedVisibility(visible || dragging, modifier = Modifier.align(Alignment.BottomCenter), enter = fadeIn(tween(150)), exit = fadeOut(tween(300))) {
- BoxWithConstraints(Modifier.fillMaxWidth().padding(start = 24.dp, end = 24.dp, bottom = bottom + 12.dp).height(32.dp)) {
- val track = with(density) { maxWidth.toPx() }
- val pillW = with(density) { 48.dp.toPx() }
- val n = (doc.pageCount - 1).coerceAtLeast(1)
- val x = if (dragging) dragX else v.currentPage.toFloat() / n * (track - pillW)
- val pageOf = stringResource(R.string.viewer_page_of, v.currentPage + 1, doc.pageCount)
- Box(Modifier.align(Alignment.CenterStart).fillMaxWidth().height(2.dp).background(c.divider))
+ val ink = com.chethan616.clearpdf.ui.glass.rememberGlassInk(clear.ink)
+ Row(
+ Modifier
+ .padding(start = 16.dp, end = 16.dp, bottom = bottom + 10.dp)
+ .widthIn(max = 560.dp)
+ .fillMaxWidth()
+ .height(44.dp)
+ .then(ink.modifier)
+ .glassBar()
+ .padding(start = 6.dp, end = 16.dp),
+ verticalAlignment = Alignment.CenterVertically,
+ ) {
+ // the page number; a tap opens Go to page
Box(
- Modifier
- .offset { IntOffset(x.roundToInt(), 0) }
- .size(48.dp, 30.dp)
- .glass(
- shape = RoundedCornerShape(15.dp),
- wash = if (c.dark) Color(0xFF0D0D10).copy(alpha = 0.64f) else Color.White.copy(alpha = 0.76f),
- blur = 2.dp,
- )
- .pointerInput(doc) { detectTapGestures(onTap = { onTap() }) }
- .pointerInput(doc) {
- detectDragGestures(
- onDragStart = { dragging = true; dragX = x },
- onDragEnd = { dragging = false },
- onDragCancel = { dragging = false },
- ) { change, d ->
- change.consume()
- dragX = (dragX + d.x).coerceIn(0f, track - pillW)
- val page = (dragX / (track - pillW).coerceAtLeast(1f) * n).roundToInt()
- if (page != v.currentPage) v.goToPage(page)
- onDrag()
- }
- }
+ Modifier.height(36.dp).widthIn(min = 64.dp).clip(RoundedCornerShape(18.dp)).pressable(onTap).padding(horizontal = 10.dp)
.semantics { contentDescription = pageOf },
contentAlignment = Alignment.Center,
) {
- Text("${v.currentPage + 1}", color = c.text, fontSize = 15.sp)
+ Text("${page + 1} / $count", color = ink.color, fontSize = 14.sp, maxLines = 1)
+ }
+ Spacer(Modifier.width(6.dp))
+ val fraction = if (count > 1) page.toFloat() / (count - 1) else 0f
+ val anim by androidx.compose.animation.core.animateFloatAsState(fraction, com.chethan616.clearpdf.ui.glass.GlassMotion.settle(), label = "pageBar")
+ Box(
+ Modifier
+ .weight(1f)
+ .fillMaxHeight()
+ .pointerInput(doc, count) {
+ // the page at a point of the track: the track's own width, read on each touch
+ fun pageAt(x: Float): Int {
+ val r = 11.dp.toPx()
+ val f = ((x - r) / (size.width - 2 * r).coerceAtLeast(1f)).coerceIn(0f, 1f)
+ return (f * (count - 1)).roundToInt()
+ }
+ fun show(p: Int) {
+ if (p != v.currentPage) {
+ v.goToPage(p)
+ feel(com.chethan616.clearpdf.ui.glass.Feel.Tick)
+ }
+ latestDrag()
+ }
+ awaitEachGesture {
+ val down = awaitFirstDown()
+ dragging = true
+ down.consume()
+ show(pageAt(down.position.x))
+ while (true) {
+ val e = awaitPointerEvent()
+ val ch = e.changes.firstOrNull { it.id == down.id } ?: break
+ if (!ch.pressed) break
+ ch.consume()
+ show(pageAt(ch.position.x))
+ }
+ dragging = false
+ }
+ },
+ contentAlignment = Alignment.CenterStart,
+ ) {
+ androidx.compose.foundation.Canvas(Modifier.fillMaxWidth().height(22.dp)) {
+ val r = size.height / 2f
+ val y = size.height / 2f
+ val x = r + anim * (size.width - 2 * r)
+ val thick = 4.dp.toPx()
+ // the track, the part read in the accent, the thumb
+ drawLine(ink.color.copy(alpha = 0.18f), Offset(r, y), Offset(size.width - r, y), thick, cap = androidx.compose.ui.graphics.StrokeCap.Round)
+ drawLine(com.chethan616.clearpdf.ui.theme.Candy.Sky, Offset(r, y), Offset(x, y), thick, cap = androidx.compose.ui.graphics.StrokeCap.Round)
+ drawCircle(Color.Black.copy(alpha = 0.18f), r, Offset(x, y + 1.dp.toPx()))
+ drawCircle(Color.White, r - 1.dp.toPx(), Offset(x, y))
+ drawCircle(com.chethan616.clearpdf.ui.theme.Candy.Sky, r * 0.38f, Offset(x, y))
+ }
}
}
}
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
index 2b54636..57db1de 100644
--- a/android/app/src/main/res/values/strings.xml
+++ b/android/app/src/main/res/values/strings.xml
@@ -444,6 +444,8 @@
<string name="viewer_read_from_here">Read from here</string>
<string name="viewer_copy_text">Copy text</string>
<string name="viewer_translate">Translate</string>
+ <string name="sheet_open_link">Open link</string>
+ <string name="msg_link_not_followed">This link goes to a file Artefact can\'t open from here</string>
<!-- Translator note: accessibility labels of the two handles at the ends of selected text. -->
<string name="viewer_selection_start">Selection start</string>
<string name="viewer_selection_end">Selection end</string>
diff --git a/android/gradle.properties b/android/gradle.properties
index ce82087..f5d1eda 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -12,5 +12,5 @@ artefact.abis=arm64-v8a,x86_64
# The app's version and its version code (before the ABI digit: see app/build.gradle.kts, the build
# checks the two agree). Set both to the release's before tagging it: the release workflow refuses a
# tag that differs, and F-Droid's update check reads them from here.
-artefact.version=3.0.0-alpha.8
-artefact.versionCode=3000008
+artefact.version=3.0.0-alpha.9
+artefact.versionCode=3000009
diff --git a/engine/mobile/src/sheets.rs b/engine/mobile/src/sheets.rs
index 77a9678..74f844d 100644
--- a/engine/mobile/src/sheets.rs
+++ b/engine/mobile/src/sheets.rs
@@ -88,6 +88,8 @@ pub struct CellView {
/// A conditional format's data bar: the part of the cell's width it fills (0: none) and its colour.
pub bar: f32,
pub bar_color: u32,
+ /// The cell's hyperlink: a web or mail address, or a place in the workbook (`Sheet2!A1`).
+ pub link: Option<String>,
pub left: CellEdge,
pub top: CellEdge,
pub right: CellEdge,
@@ -348,8 +350,14 @@ impl SheetBook {
fill = rgb(Some(scale));
}
let (bar, bar_color) = look.and_then(|l| l.bar).map_or((0.0, 0), |(f, c, _)| (f.clamp(0.0, 1.0), rgb(Some(c)).unwrap_or(0)));
+ let link = s.hyperlinks.get(&c).map(|h| h.target.trim().to_string()).filter(|t| !t.is_empty());
let b = &style.borders;
- if text.is_empty() && fill.is_none() && bar <= 0.0 && [&b.left, &b.top, &b.right, &b.bottom].iter().all(|l| l.is_none()) {
+ if text.is_empty()
+ && fill.is_none()
+ && bar <= 0.0
+ && link.is_none()
+ && [&b.left, &b.top, &b.right, &b.bottom].iter().all(|l| l.is_none())
+ {
continue;
}
let value = s.value(c);
@@ -399,6 +407,7 @@ impl SheetBook {
rotation: style.align.rotation,
bar,
bar_color,
+ link,
left: edge(&b.left),
top: edge(&b.top),
right: edge(&b.right),
diff --git a/engine/mobile/src/slides.rs b/engine/mobile/src/slides.rs
index 9851842..ea919d9 100644
--- a/engine/mobile/src/slides.rs
+++ b/engine/mobile/src/slides.rs
@@ -179,17 +179,27 @@ impl OfficeDoc for SlideDeck {
Ok(text)
}
+ /// The web and mail links of slide `page`, and its links to other slides (a slide of the deck,
+ /// the next, the previous, the first or the last), which the viewer follows as page jumps.
fn links(&self, page: u32) -> Result<Vec<LinkInfo>, MobileError> {
let i = self.slide(page)?;
+ let last = self.pres.slides.len().saturating_sub(1);
Ok(deckcraft_render::place_slide(&self.pres, i)
.links
.into_iter()
- .filter_map(|l| match &l.link.action {
- Action::Url { url } if is_web_link(url) => {
- let r = l.rect;
- Some(LinkInfo { rect: vec![r.x0 as f32, r.y0 as f32, r.x1 as f32, r.y1 as f32], uri: Some(url.clone()), page: None, top: None })
+ .filter_map(|l| {
+ let r = l.rect;
+ let rect = vec![r.x0 as f32, r.y0 as f32, r.x1 as f32, r.y1 as f32];
+ let jump = |to: usize| Some(LinkInfo { rect: rect.clone(), uri: None, page: Some(to as u32), top: None });
+ match &l.link.action {
+ Action::Url { url } if is_web_link(url) => Some(LinkInfo { rect, uri: Some(url.clone()), page: None, top: None }),
+ Action::Slide { slide } => self.pres.slide_index(*slide).and_then(jump),
+ Action::NextSlide if i < last => jump(i + 1),
+ Action::PreviousSlide if i > 0 => jump(i - 1),
+ Action::FirstSlide => jump(0),
+ Action::LastSlide => jump(last),
+ _ => None,
}
- _ => None,
})
.collect())
}
diff --git a/engine/mobile/src/tests.rs b/engine/mobile/src/tests.rs
index 6adc353..a284dc1 100644
--- a/engine/mobile/src/tests.rs
+++ b/engine/mobile/src/tests.rs
@@ -834,3 +834,67 @@ fn the_photo_editors_tools_are_settings_lightcraft_reads() {
serde_json::from_str(r#"{"crop":{"geometry":{"rect":{"x0":0.125,"y0":0.0,"x1":0.875,"y1":1.0},"angle":0.0}}}"#).unwrap();
assert_eq!((crop.crop.geometry.rect.x0, crop.crop.geometry.rect.x1), (0.125, 0.875));
}
+
+/// A link in each kind of document the viewer opens, found where it is drawn.
+#[test]
+fn links_are_found_in_every_kind_of_document() {
+ let s = MobileSession::new();
+ let uri_of = |links: &[LinkInfo]| links.iter().filter_map(|l| l.uri.clone()).collect::<Vec<_>>();
+
+ // Markdown, read by the Word engine
+ let md = scratch().join("Links.md");
+ std::fs::write(&md, "# Title\n\nSee [the site](https://example.com/md) and [mail](mailto:[email protected]).\n").unwrap();
+ let info = s.open(md.to_string_lossy().into_owned(), None).unwrap();
+ let found = uri_of(&s.links(info.id, 0).unwrap());
+ assert!(found.contains(&"https://example.com/md".to_string()), "md: {found:?}");
+ assert!(found.contains(&"mailto:[email protected]".to_string()), "md: {found:?}");
+
+ // the same as a .docx (written by the Word engine)
+ let docx = scratch().join("Links.docx");
+ s.export_office(info.id, "docx".into(), docx.to_string_lossy().into_owned()).unwrap();
+ let d = s.open(docx.to_string_lossy().into_owned(), None).unwrap();
+ assert!(uri_of(&s.links(d.id, 0).unwrap()).contains(&"https://example.com/md".to_string()), "docx");
+
+ // a presentation: a web link on text, and a shape that goes to the next slide
+ let link = |action| deckcraft_model::text::Hyperlink {
+ action,
+ tooltip: String::new(),
+ highlight_click: false,
+ sound: None,
+ stop_sound: false,
+ zoom_return: None,
+ };
+ let mut p = deckcraft_model::defaults::new_presentation(None);
+ let layout = p.slides[0].layout;
+ let second = deckcraft_model::defaults::new_slide(&mut p, layout).unwrap();
+ p.slides.push(std::sync::Arc::new(second));
+ {
+ let slide = std::sync::Arc::make_mut(p.slides.first_mut().unwrap());
+ let shape = slide.shapes.iter_mut().find(|s| s.ph.is_some()).unwrap();
+ let mut body = deckcraft_model::text::TextBody::from_text("Open the site");
+ body.paragraphs[0].runs[0].props.link = Some(link(deckcraft_model::text::Action::Url { url: "https://example.com/deck".into() }));
+ shape.text = Some(body);
+ let other = slide.shapes.iter_mut().filter(|s| s.ph.is_some()).nth(1).unwrap();
+ other.text = Some(deckcraft_model::text::TextBody::from_text("Next"));
+ other.click = Some(link(deckcraft_model::text::Action::NextSlide));
+ }
+ let pptx = scratch().join("Links.pptx");
+ std::fs::write(&pptx, deckcraft_pptx::export(&p).unwrap()).unwrap();
+ let deck = s.open(pptx.to_string_lossy().into_owned(), None).unwrap();
+ let links = s.links(deck.id, 0).unwrap();
+ assert!(uri_of(&links).contains(&"https://example.com/deck".to_string()), "pptx: {links:?}");
+ assert!(links.iter().any(|l| l.page == Some(1)), "pptx jump: {links:?}");
+
+ // a workbook: a cell's hyperlink comes with the cell
+ let (mut wb, _) = gridcraft_engine::io::open_bytes("t.csv", b"Site,Sheet\nhere,there\n").unwrap();
+ std::sync::Arc::make_mut(&mut wb.sheets[0]).hyperlinks.insert(
+ gridcraft_engine::core::CellRef::new(1, 0),
+ gridcraft_engine::model::Hyperlink { target: "https://example.com/sheet".into(), tooltip: None, external: true },
+ );
+ let xlsx = scratch().join("Links.xlsx");
+ std::fs::write(&xlsx, gridcraft_engine::io::save_bytes(&wb, "Links.xlsx").unwrap()).unwrap();
+ let book = s.open(xlsx.to_string_lossy().into_owned(), None).unwrap();
+ let cells = s.sheet_cells(book.id, 0, 0, 5, 0, 5).unwrap();
+ let cell = cells.iter().find(|c| c.row == 1 && c.col == 0).unwrap();
+ assert_eq!(cell.link.as_deref(), Some("https://example.com/sheet"));
+}
diff --git a/fastlane/metadata/android/en-US/changelogs/30000090.txt b/fastlane/metadata/android/en-US/changelogs/30000090.txt
new file mode 100644
index 0000000..7d268ff
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000090.txt
@@ -0,0 +1,9 @@
+More tools, fewer taps
+* Encryption: set a PDF password or remove it for good
+* Create PDF from typed or pasted text; PDF to text
+* Two pages side by side; a new page bar in single page mode
+* Notes as mind maps, saved as image or PDF
+* Fill & Sign finds the fields of forms that have none
+* Translate selected text; bold or italic only the selected words
+* Photo editor: crop and more tools; voice notes export as m4a
+* Links work in spreadsheets and between slides
diff --git a/fastlane/metadata/android/en-US/changelogs/30000091.txt b/fastlane/metadata/android/en-US/changelogs/30000091.txt
new file mode 100644
index 0000000..7d268ff
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000091.txt
@@ -0,0 +1,9 @@
+More tools, fewer taps
+* Encryption: set a PDF password or remove it for good
+* Create PDF from typed or pasted text; PDF to text
+* Two pages side by side; a new page bar in single page mode
+* Notes as mind maps, saved as image or PDF
+* Fill & Sign finds the fields of forms that have none
+* Translate selected text; bold or italic only the selected words
+* Photo editor: crop and more tools; voice notes export as m4a
+* Links work in spreadsheets and between slides
diff --git a/fastlane/metadata/android/en-US/changelogs/30000092.txt b/fastlane/metadata/android/en-US/changelogs/30000092.txt
new file mode 100644
index 0000000..7d268ff
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000092.txt
@@ -0,0 +1,9 @@
+More tools, fewer taps
+* Encryption: set a PDF password or remove it for good
+* Create PDF from typed or pasted text; PDF to text
+* Two pages side by side; a new page bar in single page mode
+* Notes as mind maps, saved as image or PDF
+* Fill & Sign finds the fields of forms that have none
+* Translate selected text; bold or italic only the selected words
+* Photo editor: crop and more tools; voice notes export as m4a
+* Links work in spreadsheets and between slides
diff --git a/fastlane/metadata/android/en-US/changelogs/30000093.txt b/fastlane/metadata/android/en-US/changelogs/30000093.txt
new file mode 100644
index 0000000..7d268ff
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000093.txt
@@ -0,0 +1,9 @@
+More tools, fewer taps
+* Encryption: set a PDF password or remove it for good
+* Create PDF from typed or pasted text; PDF to text
+* Two pages side by side; a new page bar in single page mode
+* Notes as mind maps, saved as image or PDF
+* Fill & Sign finds the fields of forms that have none
+* Translate selected text; bold or italic only the selected words
+* Photo editor: crop and more tools; voice notes export as m4a
+* Links work in spreadsheets and between slides
diff --git a/fastlane/metadata/android/en-US/changelogs/30000094.txt b/fastlane/metadata/android/en-US/changelogs/30000094.txt
new file mode 100644
index 0000000..7d268ff
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/30000094.txt
@@ -0,0 +1,9 @@
+More tools, fewer taps
+* Encryption: set a PDF password or remove it for good
+* Create PDF from typed or pasted text; PDF to text
+* Two pages side by side; a new page bar in single page mode
+* Notes as mind maps, saved as image or PDF
+* Fill & Sign finds the fields of forms that have none
+* Translate selected text; bold or italic only the selected words
+* Photo editor: crop and more tools; voice notes export as m4a
+* Links work in spreadsheets and between slides