Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f005d9e
fix: adjust layout-calculating heuristics
5ZYSZ3K Aug 12, 2026
ff5b21e
fix(heuristic-table-plugin): add colgrups and redistribute widths
5ZYSZ3K Sep 3, 2026
3b0e359
feat(heuristic-table-plugin): make heuristic table respect external p…
5ZYSZ3K Sep 3, 2026
2eb8ec5
feat(heuristic-table-plugin): enable configuring font coeffs for tables
5ZYSZ3K Sep 8, 2026
4237ad3
feat(heuristic-table-plugin): implement border collapsing and stick t…
5ZYSZ3K Sep 9, 2026
6c3b7ba
feat(heuristic-table-plugin): add default padding
5ZYSZ3K Sep 10, 2026
c9c70e9
feat(heuristic-table-plugin): resolve cell styles once and lay out ag…
5ZYSZ3K Sep 15, 2026
7359ad5
fix(heuristic-table-plugin): assess tests and adjust nested table ren…
5ZYSZ3K Sep 15, 2026
7247c6a
feat(heuristic-table-plugin): hide height growts behind a prop
5ZYSZ3K Sep 15, 2026
b09711d
fix(heuristic-table-plugin): horizontal and vertical paddings adjuste…
5ZYSZ3K Sep 15, 2026
b506394
fix(heuristic-table-plugin): adjust tests
5ZYSZ3K Sep 15, 2026
da969db
fix(heuristic-table-plugin): width resolution, surplus sharing and lo…
5ZYSZ3K Sep 15, 2026
a70870e
fix(heuristic-table-plugin): fill table height, preserve row heights,…
5ZYSZ3K Sep 15, 2026
2bdeca0
fix(heuristic-table-plugin): scroll fixed-height tables without clipp…
5ZYSZ3K Sep 15, 2026
322073e
fix(heuristic-table-plugin): stop requiring contentWidth in config an…
5ZYSZ3K Sep 15, 2026
fb65684
refactor(heuristic-table-plugin): share layout helpers and drop the r…
5ZYSZ3K Sep 15, 2026
c048d04
fix(heuristic-table-plugin): render stray cells without crashing and …
5ZYSZ3K Sep 15, 2026
621678e
refactor(heuristic-table-plugin): separate the table grid from config…
5ZYSZ3K Sep 15, 2026
779d3b4
refactor(heuristic-table-plugin): split oversized modules and name th…
5ZYSZ3K Sep 15, 2026
6e6257b
fix(heuristic-table-plugin): respect table direction when collapsing …
5ZYSZ3K Sep 15, 2026
2b05ff3
feat(heuristic-table-plugin): add comparison example to the app
5ZYSZ3K Sep 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 42 additions & 8 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react-native/no-inline-styles */
import React, { useCallback, useState } from 'react';
import { StatusBar } from 'expo-status-bar';
import * as WebBrowser from 'expo-web-browser';
Expand All @@ -7,7 +6,6 @@ import {
Text,
View,
ScrollView,
UIManager,
Platform,
Button,
useWindowDimensions
Expand All @@ -23,6 +21,7 @@ import SimpleExample from './SimpleExample';
import CustomExample from './CustomExample';
import YoutubeExample from './YoutubeExample';
import HeuristicTableExample from './HeuristicTableExample';
import ComparisonExample from './ComparisonExample';

const Stack = createStackNavigator();

Expand Down Expand Up @@ -147,6 +146,30 @@ function HeuristicTableScreen({ availableWidth, onLinkPress }) {
);
}

function ComparisonScreen({ availableWidth, onLinkPress }) {
const [instance, setInstance] = useState(0);
return (
<ScrollView
contentContainerStyle={styles.contentStyle}
style={styles.scrollViewStyle}>
<Text style={styles.welcome}>
The same HTML source rendered twice: once with{' '}
<Monospace>@native-html/table-plugin</Monospace> (WebView based) and
once with <Monospace>@native-html/heuristic-table-plugin</Monospace>{' '}
(pure native).
</Text>
<Button title="reload" onPress={() => setInstance((i) => i + 1)} />
<View style={styles.example}>
<ComparisonExample
availableWidth={availableWidth}
onLinkPress={onLinkPress}
instance={instance}
/>
</View>
</ScrollView>
);
}

function HomeScreen() {
const navigation = useNavigation();
return (
Expand Down Expand Up @@ -182,15 +205,16 @@ function HomeScreen() {
onPress={() => navigation.navigate('HeuristicTable')}
/>
</View>
<View style={styles.button}>
<Button
title="renderers comparison"
onPress={() => navigation.navigate('Comparison')}
/>
</View>
</View>
);
}

if (Platform.OS === 'android') {
UIManager.setLayoutAnimationEnabledExperimental &&
UIManager.setLayoutAnimationEnabledExperimental(true);
}

export default function App() {
const [url, setUrl] = useState(null);
const [isSnackVisible, setIsSnackVisible] = useState(false);
Expand All @@ -200,7 +224,7 @@ export default function App() {
setUrl(href);
}, []);
React.useEffect(() => {
url && setIsSnackVisible(true);
if (url) setIsSnackVisible(true);
}, [url]);
return (
<PaperProvider>
Expand Down Expand Up @@ -268,6 +292,16 @@ export default function App() {
/>
)}
</Stack.Screen>
<Stack.Screen
name="Comparison"
options={{ title: 'Renderers Comparison' }}>
{() => (
<ComparisonScreen
onLinkPress={onLinkPress}
availableWidth={availableWidth}
/>
)}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
<Portal>
Expand Down
Loading
Loading