npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cozy-viewer

v1.1.2

Published

Cozy-Viewer provides a component to show files in a viewer.

Downloads

245

Readme

Cozy Viewer

Cozy-Viewer provides a component to show files in a viewer.

Installation

  • You must import 'cozy-viewer/dist/stylesheet.css' somewhere in your app
  • You must have WebviewIntent Provider
  • You must have CozySharing Provider
  • In order to download and display the files, it will need a cozy-client instance in the React context.
  • To have the panels, the app need to have cozy-harvest-lib installed
  • See peer dependencies to be sure to not miss anything

Usage

import Viewer from 'cozy-viewer'

Props

  • files : <array> – One or more io.cozy.files to display
  • currentIndex : <number> – Index of the file to show
  • currentURL : <string> – Optionnal URL of the file
  • className : <string> – CSS classes
  • showNavigation : <boolean> – Whether to show left and right arrows to navigate between files
  • renderFallbackExtraContent : <function> – A render prop that is called when a file can't be displayed
  • disablePanel : <boolean> – Show/Hide the panel containing more information about the file only on Desktop
  • disableFooter : <boolean> – Show/Hide the panel containing more information about the file only on Phone & Tablet devices
  • disableModal : <boolean> – To avoid wrapping the Viewer with a Modal component (wrapper of Viewer)
  • editPathByModelProps : <object> – Edit path by model properties
    • information : <string> – URL used to edit the file when editing a information type metadata (text, date)
    • page : <string> – URL used to edit the file when editing a page type metadata (side of the document)
  • onChangeRequest : <function> - Called with (nextFile, nextIndex) when the user requests to navigate to another file
  • onCloseRequest : <function> - Called when the user wants to leave the Viewer
  • isPublic: <boolean> - Whether the viewer is used in a public page or not
  • componentsProps : <object> – Props passed to components with the same name
    • modalProps : <object> – Props passed to Modal component
    • OnlyOfficeViewer : <object> – Used to open an Only Office file
      • isEnabled : <boolean> – Whether Only Office is enabled on the server
      • opener : <function> – To open the Only Office file
    • toolbarProps : <object> – Toolbar properties
      • toolbarRef : <object> – React reference of the toolbar node
      • showToolbar : <boolean> – Whether to show the toolbar or not. Note that the built-in close button is in the toolbar
      • showClose : <boolean> – Whether to show close button in toolbar
      • showFilePath : <boolean> – Whether to show file path below his name