diff --git a/apps/mobile/deps/README.md b/apps/mobile/deps/README.md index 2cc72deb1f..5a0a7f3f39 100644 --- a/apps/mobile/deps/README.md +++ b/apps/mobile/deps/README.md @@ -16,6 +16,6 @@ Push `main` and the tag before submitting the app change, replace the old archiv ## `react-native-enriched-markdown` -Built from `main` of [aislopware/enriched-markdown](https://github.com/aislopware/enriched-markdown). Its `oni-fork.json` records the exact source commit and upstream base. React block renderers, signed image sources, the `onLinksChange` link list (`renderers`, `resolveImageSource`, `onLinksChange`), the iOS streaming memory bounds and iOS Copy as Markdown keeping bold spans whole are upstream. The fork carries only changes with an open upstream PR: clipboard link metadata ([#962](https://github.com/software-mansion/enriched-markdown/pull/962)), development-host autolinks ([#961](https://github.com/software-mansion/enriched-markdown/pull/961)) and hash-route link fragments ([mity/md4c#454](https://github.com/mity/md4c/pull/454), arriving through [md4c#7](https://github.com/software-mansion-labs/md4c/pull/7)), `md4cFlags.preserveWindowsPaths`, which keeps backslashes in Windows drive paths in prose ([#1105](https://github.com/software-mansion/enriched-markdown/pull/1105), after [mity/md4c#477](https://github.com/mity/md4c/pull/477)), GitHub's strikethrough rules for `~` ([md4c#6](https://github.com/software-mansion-labs/md4c/pull/6)), `\(…\)` and `\[…\]` math delimiters ([#1043](https://github.com/software-mansion/enriched-markdown/pull/1043), [md4c#4](https://github.com/software-mansion-labs/md4c/pull/4)), line breaks in copied table cells written as `
` ([#1144](https://github.com/software-mansion/enriched-markdown/pull/1144)), and Android measuring text in the span order its view draws it, so code blocks nested in list items no longer make a reply overlap the next message ([#1145](https://github.com/software-mansion/enriched-markdown/pull/1145)). It also carries three fork-only changes. `writingDirection="word-majority"` sets each paragraph, list item, heading and table cell right to left when its right-to-left words outnumber its left-to-right ones. It counts words as the desktop client does, but decides per paragraph where desktop decides per top-level block (Android API 29+; older Android keeps first-strong). The other two come from T3 Code's fork: iOS code blocks too big for one backing store draw through tiles, so a tall block with long lines no longer shows an empty pane ([pingdotgg/enriched-markdown#15](https://github.com/pingdotgg/enriched-markdown/pull/15)), and a long-pressed iOS blockquote lifts on the background it sits on instead of drawing its text over the thread. +Built from `main` of [aislopware/enriched-markdown](https://github.com/aislopware/enriched-markdown). Its `oni-fork.json` records the exact source commit and upstream base. React block renderers, signed image sources, the `onLinksChange` link list (`renderers`, `resolveImageSource`, `onLinksChange`), the iOS streaming memory bounds and iOS Copy as Markdown keeping bold spans whole are upstream. The fork carries only changes with an open upstream PR: clipboard link metadata ([#962](https://github.com/software-mansion/enriched-markdown/pull/962)), development-host autolinks ([#961](https://github.com/software-mansion/enriched-markdown/pull/961)) and hash-route link fragments ([mity/md4c#454](https://github.com/mity/md4c/pull/454), arriving through [md4c#7](https://github.com/software-mansion-labs/md4c/pull/7)), `md4cFlags.preserveWindowsPaths`, which keeps backslashes in Windows drive paths in prose ([#1105](https://github.com/software-mansion/enriched-markdown/pull/1105), after [mity/md4c#477](https://github.com/mity/md4c/pull/477)), GitHub's strikethrough rules for `~` ([md4c#6](https://github.com/software-mansion-labs/md4c/pull/6)), `\(…\)` and `\[…\]` math delimiters ([#1043](https://github.com/software-mansion/enriched-markdown/pull/1043), [md4c#4](https://github.com/software-mansion-labs/md4c/pull/4)), line breaks in copied table cells written as `
` ([#1144](https://github.com/software-mansion/enriched-markdown/pull/1144)), and Android measuring text in the span order its view draws it, so code blocks nested in list items no longer make a reply overlap the next message ([#1145](https://github.com/software-mansion/enriched-markdown/pull/1145)). It also carries five fork-only changes. A table inside a list item renders as a table indented under the item's text, with the list around it keeping its markers and numbers; the native renderers only split top-level blocks into views, so it used to run its cells together as text. `table.lines: 'rows'` draws tables as desktop does: lines between rows only, no outer border, and outer columns flush with the text. `writingDirection="word-majority"` sets each paragraph, list item, heading and table cell right to left when its right-to-left words outnumber its left-to-right ones. It counts words as the desktop client does, but decides per paragraph where desktop decides per top-level block (Android API 29+; older Android keeps first-strong). The last two come from T3 Code's fork: iOS code blocks too big for one backing store draw through tiles, so a tall block with long lines no longer shows an empty pane ([pingdotgg/enriched-markdown#15](https://github.com/pingdotgg/enriched-markdown/pull/15)), and a long-pressed iOS blockquote lifts on the background it sits on instead of drawing its text over the thread. To replace it, commit the fork changes on `main` with the next `1.2.0-oni.N` version, run `yarn install --immutable` and `yarn workspace react-native-enriched-markdown prepare` in the fork checkout, then `yarn workspace react-native-enriched-markdown pack:onicode /absolute/path/to/onicode/apps/mobile/deps`. Tag the source commit `oni-v` and push `main` and the tag to the fork. Rename the archive to include the first eight characters of the source commit, as in `react-native-enriched-markdown--.tgz`, so each build has a distinct dependency path. Update the tarball path in `apps/mobile/package.json` and `pnpm-workspace.yaml`'s `allowBuilds`, and run `vp i` to update the lockfile. diff --git a/apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz b/apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz deleted file mode 100644 index 379148dc32..0000000000 Binary files a/apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz and /dev/null differ diff --git a/apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz b/apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz new file mode 100644 index 0000000000..7de33a1900 Binary files /dev/null and b/apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz differ diff --git a/apps/mobile/package.json b/apps/mobile/package.json index ff8a7c1ee6..c9b335a931 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -104,7 +104,7 @@ "react": "catalog:", "react-dom": "catalog:", "react-native": "0.88.1", - "react-native-enriched-markdown": "file:deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz", + "react-native-enriched-markdown": "file:deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz", "react-native-gesture-handler": "~3.5.0", "react-native-image-viewing": "^0.2.2", "react-native-keyboard-controller": "1.23.1", diff --git a/apps/mobile/src/native/EnrichedMarkdownText.tsx b/apps/mobile/src/native/EnrichedMarkdownText.tsx index c6d12443fd..f7ff3e4222 100644 --- a/apps/mobile/src/native/EnrichedMarkdownText.tsx +++ b/apps/mobile/src/native/EnrichedMarkdownText.tsx @@ -53,7 +53,6 @@ function enrichedStyle( const monospace = Platform.OS === "ios" ? "Menlo" : "monospace"; // Android only bolds fallback glyphs when the bold family is asked for at a bold weight (app.config.ts). const boldFontWeight = Platform.OS === "android" ? "bold" : undefined; - // Keep the radius modest: iOS clips square table-cell borders without stroking the corner arcs. const block = { marginTop: 4, marginBottom: 12, @@ -161,15 +160,20 @@ function enrichedStyle( gapWidth: 12 * fontScale, }, thematicBreak: { color: style.dividerColor, height: 1, marginTop: 8, marginBottom: 8 }, + // As desktop draws tables: lines between rows only, outer columns flush with the prose, one step smaller. table: { ...body, ...block, + fontSize: style.fontSize * (14 / 15), + lineHeight: style.lineHeight * (14 / 15), headerFontFamily: style.boldFontFamily, headerTextColor: style.strongColor, - headerBackgroundColor: style.codeBlockBackgroundColor, + headerBackgroundColor: "transparent", rowEvenBackgroundColor: "transparent", rowOddBackgroundColor: "transparent", - cellPaddingHorizontal: 10, + borderRadius: 0, + lines: "rows", + cellPaddingHorizontal: 12, cellPaddingVertical: 7, }, taskList: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b9e4a2bc2..5a1381fbb6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -681,8 +681,8 @@ importers: specifier: 0.88.1 version: 0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) react-native-enriched-markdown: - specifier: file:deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz - version: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz(katex@0.19.1)(react-native@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) + specifier: file:deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz + version: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz(katex@0.19.1)(react-native@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) react-native-gesture-handler: specifier: 3.5.0 version: 3.5.0(patch_hash=171379dd378f8f11e9187876dec2116e5cbf5f21cef6576cdde6956518324f98)(react-native@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) @@ -11028,9 +11028,9 @@ packages: react-is@19.3.1: resolution: {integrity: sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==} - react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz: - resolution: {integrity: sha512-cHO27a3skDKgX/2I9nmMVJg4P4E8DHOVJ74NInm4i758X33YMQk6nuVbrYO29Fct9JT7BYc6mbAZoLovpluMWA==, tarball: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz} - version: 1.2.0-oni.25 + react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz: + resolution: {integrity: sha512-K2g1B1pcPMst2vHp6f0AfpY4n43fiT5oVrBaQ/gNS1JSuV6o9I5qVFwkzy76Fl7UlczrQl08g2NJBzmySU3kqQ==, tarball: file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz} + version: 1.2.0-oni.26 peerDependencies: katex: '>=0.16.0' react: '*' @@ -21182,7 +21182,7 @@ snapshots: react-is@19.3.1: {} - react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz(katex@0.19.1)(react-native@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0): + react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz(katex@0.19.1)(react-native@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0): dependencies: react: 19.3.0 react-native: 0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.13(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b084b0faa8..22dacb61f7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -27,7 +27,7 @@ allowBuilds: objc-js: false # Its postinstall only prints a banner. react-native-pdf-jsi: false - "react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.25-40e822ce.tgz": true + "react-native-enriched-markdown@file:apps/mobile/deps/react-native-enriched-markdown-1.2.0-oni.26-c09c93bb.tgz": true sharp: true utf-8-validate: false # Verifies the workerd binary for the push gateway's local dev server.