{"id":19432807,"url":"https://github.com/brightspace/react-valence-ui-fileviewer","last_synced_at":"2025-08-25T23:02:59.850Z","repository":{"id":42386786,"uuid":"42949648","full_name":"Brightspace/react-valence-ui-fileviewer","owner":"Brightspace","description":"React component for viewing files","archived":false,"fork":false,"pushed_at":"2024-07-04T14:59:54.000Z","size":6287,"stargazers_count":2,"open_issues_count":6,"forks_count":12,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-24T20:41:47.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brightspace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-22T17:31:08.000Z","updated_at":"2024-08-05T07:52:20.000Z","dependencies_parsed_at":"2024-02-26T17:54:16.873Z","dependency_job_id":"c957e078-0f78-44d2-9d63-3aed85244126","html_url":"https://github.com/Brightspace/react-valence-ui-fileviewer","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/Brightspace/react-valence-ui-fileviewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Freact-valence-ui-fileviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Freact-valence-ui-fileviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Freact-valence-ui-fileviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Freact-valence-ui-fileviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brightspace","download_url":"https://codeload.github.com/Brightspace/react-valence-ui-fileviewer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Freact-valence-ui-fileviewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272144649,"owners_count":24881141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T14:37:14.011Z","updated_at":"2025-08-25T23:02:59.820Z","avatar_url":"https://github.com/Brightspace.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-valence-ui-fileviewer\n[![Build status][ci-image]][ci-url]\n\nReact component for viewing different types of files (HTML, media, documents, etc.).\n\n## Installation\n\nInstall NPM dependencies:\n\n```shell\nnpm install\n```\n\nAdditionally, to get the fallback (non-native) PDF renderer working, you will need to reference some dependencies from the CDN.\nThese must be referenced _before_ referencing the css and js files containing the code for this component.\n\nIf switching to a newer version of pdf.js, [pdf.settings.js](https://github.com/Brightspace/valence-ui-pdfjs-settings) may need to be updated.\n\n```css\n\u003clink rel=\"stylesheet\" href=\"https://s.brightspace.com/lib/pdf.js/1.2.109/pdf_viewer.css\"\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"dist/app.css\"\u003e\n```\n\n```html\n\u003cscript src=\"https://s.brightspace.com/lib/pdf.js/1.2.109/pdf.settings.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://s.brightspace.com/lib/pdf.js/1.2.109/compatibility.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://s.brightspace.com/lib/pdf.js/1.2.109/pdf.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://s.brightspace.com/lib/pdf.js/1.2.109/pdf_viewer.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/app.js\"\u003e\u003c/script\u003e\n```\n\nIf you want to incorporate this component and build it from source you will also need to use browserify-shim to configure the PDFJS global variable.\n\n```json\n(in package.json)\n\n\"browserify\": {\n  \"transform\": [\n    \"browserify-shim\"\n  ]\n},\n\"browserify-shim\": {\n  \"pdfjs\": \"global:PDFJS\"\n}\n```\n\n## Testing\n\nThis project uses the [Jest](https://facebook.github.io/jest/) unit testing framework. To run the unit tests:\n\n```shell\nnpm run test:unit\n```\n\nCode is also linted using [eslint](http://eslint.org/):\n\n```shell\nnpm run lint\n```\n\nBoth unit tests and linting is performed during CI builds as part of the `test` script:\n\n```shell\nnpm test\n```\n\n## Sample\n\nIncluded is a sample application which allows you to launch the file viewer with many different file types. To build the sample application, run:\n\n```shell\nnpm run build-sample\n```\n\nTo serve the sample application, run:\n\n```shell\nnpm run serve\n```\n\nThen open `http://localhost:8080/` in your browser.\n\n## Parameters\nFileViewer has the following parameters:\n\n`progressCallback` Takes a callback function, which should accept 2 parameters, the first reflecting the progress, and the second reflecting the accuracy of the progress value.\n\n* progress: A number between 0 and 100 indicating the percentage loaded.\n* accuracy: The accuracy of the returned progress value, currently we choose between two options:\n\t* `certain`: indicates that progress will be a number between 0 and 100\n\t* `guess`: indicates that progress will be a number between 0 and 100, and that the progress may not be accurate\n\t* `none`: indicates that it will only pass in progress values of 0 or 100\n\n```\nresizeCallback ( size, sizeKnown )\n```\n* A callback reporting on the size of the viewer's contents.\n\n`size`\n* A `string` value for the size of the viewer if we can find it out.\n* `null` if the viewer should just be sized to the container height.\n\n`sizeKnown`\n* True if the size is known.\n* False if the size is not known.\n\n## Versioning and Releasing\n\nThis repo is configured to use `semantic-release`. Commits prefixed with `fix:` and `feat:` will trigger patch and minor releases when merged to `main`.\n\nTo learn how to create major releases and release from maintenance branches, refer to the [semantic-release GitHub Action](https://github.com/BrightspaceUI/actions/tree/main/semantic-release) documentation.\n```\n\n## Contributing\nContributions are welcome, please submit a pull request!\n\n### Code Style \n\nThis repository is configured with [EditorConfig](http://editorconfig.org) and [eslint](http://eslint.org/) rules and contributions should make use of them.\n\n[ci-url]: https://travis-ci.org/Brightspace/react-valence-ui-fileviewer\n[ci-image]: https://img.shields.io/travis/Brightspace/react-valence-ui-fileviewer.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrightspace%2Freact-valence-ui-fileviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrightspace%2Freact-valence-ui-fileviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrightspace%2Freact-valence-ui-fileviewer/lists"}