├── .editorconfig ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── enhancement.md │ └── feature_request.md └── workflows │ ├── codeql-analysis.yml │ ├── core.yml │ ├── heuristic-table.yml │ ├── iframe.yml │ └── table.yml ├── .gitignore ├── .prettierrc.js ├── .yarn ├── plugins │ └── @yarnpkg │ │ └── plugin-interactive-tools.cjs └── releases │ └── yarn-3.0.2.cjs ├── .yarnrc.yml ├── LICENSE ├── README.md ├── codecov.yml ├── commitlint.config.js ├── example ├── .expo-shared │ └── assets.json ├── .gitignore ├── App.js ├── ClickTable.js ├── CustomExample.js ├── HeuristicTableExample.js ├── SimpleExample.js ├── YoutubeExample.js ├── app.config.js ├── assets │ ├── favicon.png │ └── icon.png ├── babel.config.js ├── index.js ├── metro.config.js └── package.json ├── images ├── TableStyleSpecs.png ├── TableStyleSpecs.svg ├── adaptative.jpeg ├── android.gif ├── expo-example.png └── scalesPageToFit.jpg ├── package.json ├── packages ├── heuristic-table-plugin │ ├── .gitignore │ ├── .release-it.js │ ├── CHANGELOG.md │ ├── README.md │ ├── api-extractor.json │ ├── babel.config.js │ ├── docs │ │ ├── heuristic-table-plugin.cellproperties.constraints.md │ │ ├── heuristic-table-plugin.cellproperties.lenx.md │ │ ├── heuristic-table-plugin.cellproperties.leny.md │ │ ├── heuristic-table-plugin.cellproperties.md │ │ ├── heuristic-table-plugin.coordinates.md │ │ ├── heuristic-table-plugin.coordinates.x.md │ │ ├── heuristic-table-plugin.coordinates.y.md │ │ ├── heuristic-table-plugin.displaycell.md │ │ ├── heuristic-table-plugin.displaycell.tnode.md │ │ ├── heuristic-table-plugin.heuristictablepluginconfig.forcestretch.md │ │ ├── heuristic-table-plugin.heuristictablepluginconfig.getstyleforcell.md │ │ ├── heuristic-table-plugin.heuristictablepluginconfig.md │ │ ├── heuristic-table-plugin.htmltable.md │ │ ├── heuristic-table-plugin.htmltableprops.config.md │ │ ├── heuristic-table-plugin.htmltableprops.layout.md │ │ ├── heuristic-table-plugin.htmltableprops.md │ │ ├── heuristic-table-plugin.htmltableprops.settings.md │ │ ├── heuristic-table-plugin.md │ │ ├── heuristic-table-plugin.renderers.md │ │ ├── heuristic-table-plugin.tablecell.md │ │ ├── heuristic-table-plugin.tablecell.type.md │ │ ├── heuristic-table-plugin.tablecell.width.md │ │ ├── heuristic-table-plugin.tablecellpropsfromparent.cell.md │ │ ├── heuristic-table-plugin.tablecellpropsfromparent.config.md │ │ ├── heuristic-table-plugin.tablecellpropsfromparent.md │ │ ├── heuristic-table-plugin.tableflexcolumncontainer.children.md │ │ ├── heuristic-table-plugin.tableflexcolumncontainer.md │ │ ├── heuristic-table-plugin.tableflexcolumncontainer.type.md │ │ ├── heuristic-table-plugin.tableflexrowcontainer.children.md │ │ ├── heuristic-table-plugin.tableflexrowcontainer.md │ │ ├── heuristic-table-plugin.tableflexrowcontainer.type.md │ │ ├── heuristic-table-plugin.tablerenderer.md │ │ ├── heuristic-table-plugin.tableroot.children.md │ │ ├── heuristic-table-plugin.tableroot.md │ │ ├── heuristic-table-plugin.tableroot.type.md │ │ ├── heuristic-table-plugin.tdrenderer.md │ │ ├── heuristic-table-plugin.threnderer.md │ │ ├── heuristic-table-plugin.usehtmltablecellprops.md │ │ ├── heuristic-table-plugin.usehtmltableprops.md │ │ └── index.md │ ├── etc │ │ └── heuristic-table-plugin.api.md │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── HTMLTable.tsx │ │ ├── TableLayout.ts │ │ ├── TableRenderer.ts │ │ ├── TdRenderer.tsx │ │ ├── ThRenderer.ts │ │ ├── TreeRenderer.tsx │ │ ├── helpers │ │ │ ├── TCellConstraintsComputer.ts │ │ │ ├── __tests__ │ │ │ │ ├── createRenderTree.test.ts │ │ │ │ ├── fillTableDisplay.test.ts │ │ │ │ ├── makeRows.test.ts │ │ │ │ ├── reduceColumnConstraints.test.ts │ │ │ │ └── utils.ts │ │ │ ├── computeColumnWidths.ts │ │ │ ├── createRenderTree.ts │ │ │ ├── fillTableDisplay.ts │ │ │ ├── makeRows.ts │ │ │ ├── measure.ts │ │ │ └── reduceColumnConstraints.ts │ │ ├── index.ts │ │ ├── shared-types.ts │ │ ├── useHtmlTableCellProps.ts │ │ └── useHtmlTableProps.ts │ ├── test.html │ ├── tsconfig.build.json │ └── tsconfig.json ├── iframe-plugin │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── .release-it.js │ ├── CHANGELOG.md │ ├── README.md │ ├── api-extractor.json │ ├── babel.config.js │ ├── docs │ │ ├── iframe-plugin.htmliframe.md │ │ ├── iframe-plugin.htmliframeprops.htmlattribs.md │ │ ├── iframe-plugin.htmliframeprops.md │ │ ├── iframe-plugin.htmliframeprops.onlinkpress.md │ │ ├── iframe-plugin.htmliframeprops.scalefactor.md │ │ ├── iframe-plugin.htmliframeprops.source.md │ │ ├── iframe-plugin.htmliframeprops.style.md │ │ ├── iframe-plugin.htmliframeprops.webview.md │ │ ├── iframe-plugin.htmliframeprops.webviewprops.md │ │ ├── iframe-plugin.iframeconfig.injectedcssstyles.md │ │ ├── iframe-plugin.iframeconfig.md │ │ ├── iframe-plugin.iframeconfig.removebodyspacing.md │ │ ├── iframe-plugin.iframeconfig.scalespagetofit.md │ │ ├── iframe-plugin.iframeconfig.webviewprops.md │ │ ├── iframe-plugin.iframemodel.md │ │ ├── iframe-plugin.iframerenderer.md │ │ ├── iframe-plugin.md │ │ ├── iframe-plugin.usehtmliframeprops.md │ │ └── index.md │ ├── etc │ │ └── iframe-plugin.api.md │ ├── jest.config.js │ ├── package.json │ ├── src │ │ ├── HTMLIframe.tsx │ │ ├── IframeRenderer.ts │ │ ├── __tests__ │ │ │ ├── IframeRenderer.test.tsx │ │ │ └── extractPrintDimensions.test.ts │ │ ├── extractPrintDimensions.ts │ │ ├── index.ts │ │ └── useHtmlIframeProps.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── plugins-core │ ├── .eslintrc.js │ ├── .gitignore │ ├── .release-it.js │ ├── CHANGELOG.md │ ├── api-extractor.json │ ├── babel.config.js │ ├── etc │ │ └── plugins-core.api.md │ ├── package.json │ ├── src │ │ ├── __tests__ │ │ │ └── linkPressTargetToOnDOMLinkPressArgs.test.ts │ │ ├── index.ts │ │ └── linkPressTargetToOnDOMLinkPressArgs.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── release-config │ ├── index.js │ └── package.json └── table-plugin │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .release-it.js │ ├── CHANGELOG.md │ ├── README.md │ ├── api-extractor.json │ ├── babel.config.js │ ├── docs │ ├── index.md │ ├── table-plugin.cssrulesfromspecs.md │ ├── table-plugin.defaulttablestylesspecs.md │ ├── table-plugin.htmltable.md │ ├── table-plugin.htmltablebaseprops.html.md │ ├── table-plugin.htmltablebaseprops.htmlattribs.md │ ├── table-plugin.htmltablebaseprops.md │ ├── table-plugin.htmltablebaseprops.onlinkpress.md │ ├── table-plugin.htmltablebaseprops.sourcebaseurl.md │ ├── table-plugin.htmltablebaseprops.webview.md │ ├── table-plugin.htmltableprops.md │ ├── table-plugin.htmltablestats.md │ ├── table-plugin.htmltablestats.numofchars.md │ ├── table-plugin.htmltablestats.numofcolumns.md │ ├── table-plugin.htmltablestats.numofrows.md │ ├── table-plugin.md │ ├── table-plugin.tableaccuratecontentheightstate.contentheight.md │ ├── table-plugin.tableaccuratecontentheightstate.md │ ├── table-plugin.tableaccuratecontentheightstate.type.md │ ├── table-plugin.tableconfig.animationduration.md │ ├── table-plugin.tableconfig.animationtype.md │ ├── table-plugin.tableconfig.computecontainerheight.md │ ├── table-plugin.tableconfig.computeheuristiccontentheight.md │ ├── table-plugin.tableconfig.cssrules.md │ ├── table-plugin.tableconfig.displaymode.md │ ├── table-plugin.tableconfig.maxscale.md │ ├── table-plugin.tableconfig.md │ ├── table-plugin.tableconfig.style.md │ ├── table-plugin.tableconfig.tablestylespecs.md │ ├── table-plugin.tableconfig.webviewprops.md │ ├── table-plugin.tablecontentheightstate.md │ ├── table-plugin.tableheuristiccontentheightstate.contentheight.md │ ├── table-plugin.tableheuristiccontentheightstate.md │ ├── table-plugin.tableheuristiccontentheightstate.type.md │ ├── table-plugin.tablemodel.md │ ├── table-plugin.tablerenderer.md │ ├── table-plugin.tablestylespecs.cellpaddingem.md │ ├── table-plugin.tablestylespecs.columnsborderwidthpx.md │ ├── table-plugin.tablestylespecs.fitcontainerheight.md │ ├── table-plugin.tablestylespecs.fitcontainerwidth.md │ ├── table-plugin.tablestylespecs.fontfamily.md │ ├── table-plugin.tablestylespecs.fontsizepx.md │ ├── table-plugin.tablestylespecs.linkcolor.md │ ├── table-plugin.tablestylespecs.md │ ├── table-plugin.tablestylespecs.outerbordercolor.md │ ├── table-plugin.tablestylespecs.outerborderwidthpx.md │ ├── table-plugin.tablestylespecs.rowsborderwidthpx.md │ ├── table-plugin.tablestylespecs.selectabletext.md │ ├── table-plugin.tablestylespecs.tdbordercolor.md │ ├── table-plugin.tablestylespecs.thbordercolor.md │ ├── table-plugin.tablestylespecs.thevenbackground.md │ ├── table-plugin.tablestylespecs.thevencolor.md │ ├── table-plugin.tablestylespecs.thoddbackground.md │ ├── table-plugin.tablestylespecs.thoddcolor.md │ ├── table-plugin.tablestylespecs.trevenbackground.md │ ├── table-plugin.tablestylespecs.trevencolor.md │ ├── table-plugin.tablestylespecs.troddbackground.md │ ├── table-plugin.tablestylespecs.troddcolor.md │ └── table-plugin.usehtmltableprops.md │ ├── etc │ └── table-plugin.api.md │ ├── jest.config.js │ ├── jest │ └── setupJest.js │ ├── package.json │ ├── src │ ├── HTMLTable.tsx │ ├── TableRenderer.ts │ ├── __tests__ │ │ ├── HTMLTable.test.tsx │ │ ├── extractHtmlAndStatsFromTableDomNode.test.ts │ │ └── setup.ts │ ├── css-rules.ts │ ├── extractHtmlAndStatsFromTableDomNode.ts │ ├── index.ts │ ├── types.ts │ └── useHtmlTableProps.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── patches ├── @release-it-conventional-changelog.patch └── release-it.patch ├── tsconfig-base.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: ['@react-native-community', 'plugin:compat/recommended', 'prettier'], 4 | parser: '@typescript-eslint/parser', 5 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], 6 | rules: { 7 | 'comma-dangle': ['error', 'never'], 8 | '@typescript-eslint/no-unused-vars': [ 9 | 'error', 10 | { vars: 'all', args: 'after-used', ignoreRestSiblings: true } 11 | ] 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Getting Help 4 | url: https://discord.gg/3B9twTMEzb 5 | about: Visit our Discord "plugins" channel. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement 3 | about: Describe a non-feature change you wish to take place. 4 | title: '' 5 | labels: 'enhancement' 6 | --- 7 | 8 | ### Oath 9 | 10 | I swear that I have completed these tasks before submitting: 11 | 12 | - [ ] I have read the README 13 | - [ ] I have checked that the issue has not been reported yet 14 | - [ ] I have prefixed this issue title with the plugin suffix (e.g: [iframe-plugin]) depending on the affected plugin 15 | ### Decision table 16 | 17 | 25 | 26 | - [ ] The change I am requesting is not a new React prop 27 | - [ ] The change I am requesting is not support for a standard HTML attribute, 28 | CSS rule or anything related to HTML and CSS standards 29 | - [ ] The change I am requesting is not support or compatibility with a React 30 | Native feature 31 | 32 | 33 | ### Enhancement 34 | 35 | 39 | 40 | (Describe the enhancement here.) 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Describe a new feature for this library. 4 | title: '' 5 | labels: 'new feature' 6 | --- 7 | 8 | ### Oath 9 | 10 | I swear that I have completed these tasks before submitting: 11 | 12 | - [ ] I have read the README 13 | - [ ] I have checked that the feature request has not been reported yet 14 | - [ ] I have prefixed this issue title with the plugin suffix (e.g: [iframe-plugin]) depending on the affected plugin 15 | 16 | ### Decision table 17 | 18 | 26 | 27 | 28 | - [ ] The change I am requesting is not concerning performance 29 | - [ ] The change I am requesting is not concerning code style, compliance with 30 | official guidelines and recommendations, third-party deprecations, 31 | refactoring or development tooling 32 | 33 | ### Feature 34 | 35 | 40 | 41 | (Describe the feature here.) 42 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | name: "CodeQL" 7 | 8 | on: 9 | push: 10 | branches: [master] 11 | pull_request: 12 | # The branches below must be a subset of the branches above 13 | branches: [master] 14 | schedule: 15 | - cron: '0 3 * * 3' 16 | 17 | jobs: 18 | analyze: 19 | name: Analyze 20 | runs-on: ubuntu-latest 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | # Override automatic language detection by changing the below list 26 | # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] 27 | language: ['javascript'] 28 | # Learn more... 29 | # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection 30 | 31 | steps: 32 | - name: Checkout repository 33 | uses: actions/checkout@v2 34 | with: 35 | # We must fetch at least the immediate parents so that if this is 36 | # a pull request then we can checkout the head. 37 | fetch-depth: 2 38 | 39 | # If this run was triggered by a pull request event, then checkout 40 | # the head of the pull request instead of the merge commit. 41 | - run: git checkout HEAD^2 42 | if: ${{ github.event_name == 'pull_request' }} 43 | 44 | # Initializes the CodeQL tools for scanning. 45 | - name: Initialize CodeQL 46 | uses: github/codeql-action/init@v1 47 | with: 48 | languages: ${{ matrix.language }} 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # ℹ️ Command-line programs to run using the OS shell. 55 | # 📚 https://git.io/JvXDl 56 | 57 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 58 | # and modify them (or add more) to build your code if your project 59 | # uses a compiled language 60 | 61 | #- run: | 62 | # make bootstrap 63 | # make release 64 | 65 | - name: Perform CodeQL Analysis 66 | uses: github/codeql-action/analyze@v1 67 | -------------------------------------------------------------------------------- /.github/workflows/core.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, run JS and Typescript tests. 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: core 5 | 6 | on: [push, pull_request] 7 | 8 | jobs: 9 | test: 10 | name: Testing 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - run: yarn install --immutable 24 | - run: yarn workspace @native-html/plugins-core test:ts 25 | name: Typescript Tests 26 | - run: yarn workspace @native-html/plugins-core test:lint 27 | name: Linting Tests 28 | - run: yarn workspace @native-html/plugins-core test:jest --coverage 29 | name: Behavior Tests 30 | - run: yarn workspace @native-html/plugins-core build 31 | name: Build 32 | - uses: codecov/codecov-action@v1 33 | with: 34 | flags: plugins-core 35 | fail_ci_if_error: true 36 | -------------------------------------------------------------------------------- /.github/workflows/heuristic-table.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, run JS and Typescript tests. 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: heuristic-table 5 | 6 | on: [push, pull_request] 7 | 8 | jobs: 9 | test: 10 | name: Testing 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - run: yarn install --immutable 24 | - run: yarn build:core 25 | name: Build core 26 | - run: yarn workspace @native-html/heuristic-table-plugin test:ts 27 | name: Typescript Tests 28 | - run: yarn workspace @native-html/heuristic-table-plugin test:lint 29 | name: Linting Tests 30 | - run: yarn workspace @native-html/heuristic-table-plugin test:jest --coverage 31 | name: Behavior Tests 32 | - run: yarn workspace @native-html/heuristic-table-plugin build 33 | name: Build 34 | - uses: codecov/codecov-action@v1 35 | with: 36 | flags: heuristic-table-plugin 37 | fail_ci_if_error: true 38 | -------------------------------------------------------------------------------- /.github/workflows/iframe.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, run JS and Typescript tests. 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: iframe 5 | 6 | on: [push, pull_request] 7 | 8 | jobs: 9 | test: 10 | name: Testing 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - run: yarn install --immutable 24 | - run: yarn build:core 25 | name: Build core 26 | - run: yarn workspace @native-html/iframe-plugin test:ts 27 | name: Typescript Tests 28 | - run: yarn workspace @native-html/iframe-plugin test:lint 29 | name: Linting Tests 30 | - run: yarn workspace @native-html/iframe-plugin test:jest --coverage 31 | name: Behavior Tests 32 | - run: yarn workspace @native-html/iframe-plugin build 33 | name: Build 34 | - uses: codecov/codecov-action@v1 35 | with: 36 | flags: iframe-plugin 37 | fail_ci_if_error: true 38 | -------------------------------------------------------------------------------- /.github/workflows/table.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of node dependencies, run JS and Typescript tests. 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: table 5 | 6 | on: [push, pull_request] 7 | 8 | jobs: 9 | test: 10 | name: Testing 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | node-version: [14.x] 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | - run: yarn install --immutable 24 | - run: yarn build:core 25 | name: Build core 26 | - run: yarn workspace @native-html/table-plugin test:ts 27 | name: Typescript Tests 28 | - run: yarn workspace @native-html/table-plugin test:lint 29 | name: Linting Tests 30 | - run: yarn workspace @native-html/table-plugin test:jest --coverage 31 | name: Behavior Tests 32 | - run: yarn workspace @native-html/table-plugin build 33 | name: Build 34 | - uses: codecov/codecov-action@v1 35 | with: 36 | flags: table-plugin 37 | fail_ci_if_error: true 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # Visual Studio Code 33 | # 34 | .vscode/ 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | yarn-error.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | !debug.keystore 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://docs.fastlane.tools/best-practices/source-control/ 54 | 55 | */fastlane/report.xml 56 | */fastlane/Preview.html 57 | */fastlane/screenshots 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | *.todos 63 | 64 | # yarn berry 65 | .yarn/* 66 | !.yarn/releases 67 | !.yarn/plugins 68 | !.yarn/sdks 69 | !.yarn/versions 70 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'none', 6 | }; 7 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | enableGlobalCache: true 2 | 3 | nodeLinker: node-modules 4 | 5 | plugins: 6 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 7 | spec: "@yarnpkg/plugin-interactive-tools" 8 | 9 | yarnPath: .yarn/releases/yarn-3.0.2.cjs 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2019-2020 Jules Sam. Randolph. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | precision: 2 3 | round: down 4 | range: '80...100' 5 | status: 6 | project: 7 | default: 8 | target: auto 9 | table-plugin: 10 | target: auto 11 | flags: 12 | - table-plugin 13 | iframe-plugin: 14 | target: auto 15 | flags: 16 | - iframe-plugin 17 | heuristic-table-plugin: 18 | target: auto 19 | flags: 20 | - heuristic-table-plugin 21 | plugins-core: 22 | target: auto 23 | flags: 24 | - plugins-core 25 | 26 | flags: 27 | table-plugin: 28 | paths: 29 | - packages/table-plugin/ 30 | heuristic-table-plugin: 31 | paths: 32 | - packages/heuristic-table-plugin/ 33 | iframe-plugin: 34 | paths: 35 | - packages/iframe-plugin/ 36 | plugins-core: 37 | paths: 38 | - packages/plugins-core/ 39 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'] 3 | }; 4 | -------------------------------------------------------------------------------- /example/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | *.jks 5 | *.p8 6 | *.p12 7 | *.key 8 | *.mobileprovision 9 | *.orig.* 10 | web-build/ 11 | 12 | # macOS 13 | .DS_Store 14 | -------------------------------------------------------------------------------- /example/ClickTable.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable react-native/no-inline-styles */ 2 | import React, { useState } from 'react'; 3 | import { View, Button, Text, StyleSheet } from 'react-native'; 4 | import { Modal, Portal } from 'react-native-paper'; 5 | import { HTMLTable } from '@native-html/table-plugin'; 6 | import WebView from 'react-native-webview'; 7 | import { useSafeAreaInsets } from 'react-native-safe-area-context'; 8 | 9 | const tableConfig = { 10 | WebView, 11 | animationType: 'animated' 12 | }; 13 | 14 | const unconstrainedHeight = () => null; 15 | 16 | export default function ClickTable(props) { 17 | const [isModalVisible, setIsModalVisible] = useState(false); 18 | const { top } = useSafeAreaInsets(); 19 | const { numOfRows, numOfColumns, numOfChars } = props; 20 | // If table contains less then 100 chars or has less then 4 columns and 8 rows, 21 | // show table inline 22 | const shouldRenderTableInline = 23 | numOfChars < 400 || (numOfColumns < 4 && numOfRows < 8); 24 | const description = ( 25 | 26 | This table has {numOfColumns} columns, {numOfRows} rows and contains{' '} 27 | {numOfChars} readable characters. 28 | {shouldRenderTableInline 29 | ? 'Therefore, it should be rendered inline.' 30 | : 'Therefore, it should be rendered in a modal.'} 31 | 32 | ); 33 | if (shouldRenderTableInline) { 34 | return ( 35 | 36 | {description} 37 | 1000} 39 | autoheight={true} 40 | {...props} 41 | {...tableConfig} 42 | /> 43 | 44 | ); 45 | } 46 | // else, show a buton with modal 47 | return ( 48 | 49 | {description} 50 |