20.0.0 • Published 6 months ago

cozy-viewer v20.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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
19.0.0

6 months ago

20.0.0

6 months ago

19.1.0

6 months ago

19.1.1

6 months ago

18.1.0

6 months ago

18.0.3

7 months ago

18.0.2

7 months ago

18.0.1

7 months ago

18.0.0

7 months ago

17.0.0

7 months ago

16.2.1

7 months ago

15.1.1

8 months ago

15.1.0

8 months ago

16.1.0

7 months ago

16.2.0

7 months ago

16.0.0

7 months ago

13.3.1

8 months ago

13.3.2

8 months ago

13.3.0

8 months ago

15.0.0

8 months ago

15.0.1

8 months ago

13.2.6

8 months ago

13.2.4

8 months ago

13.2.5

8 months ago

13.2.3

8 months ago

14.0.0

8 months ago

14.0.1

8 months ago

14.0.2

8 months ago

13.1.0

8 months ago

13.2.2

8 months ago

13.2.0

8 months ago

13.0.2

8 months ago

13.2.1

8 months ago

12.0.3

8 months ago

12.0.0

8 months ago

12.0.1

8 months ago

12.0.2

8 months ago

13.0.0

8 months ago

13.0.1

8 months ago

11.4.0

9 months ago

11.2.0

9 months ago

11.3.3

9 months ago

11.3.4

9 months ago

11.3.1

9 months ago

11.3.2

9 months ago

11.3.0

9 months ago

11.1.0

9 months ago

10.0.0

9 months ago

9.1.1

9 months ago

9.1.0

9 months ago

11.0.0

9 months ago

9.0.2

9 months ago

8.0.9

9 months ago

8.0.8

9 months ago

8.0.5

9 months ago

8.0.4

9 months ago

8.0.7

9 months ago

8.0.6

9 months ago

8.1.0

9 months ago

8.0.3

9 months ago

9.0.1

9 months ago

9.0.0

9 months ago

8.0.1

9 months ago

8.0.2

9 months ago

6.0.1

9 months ago

6.0.0

9 months ago

7.0.0

9 months ago

7.0.2

9 months ago

7.0.1

9 months ago

8.0.0

9 months ago

5.1.1

10 months ago

5.1.0

10 months ago

5.0.0

10 months ago

3.0.1

10 months ago

3.0.0

10 months ago

4.0.0

10 months ago

2.9.1

10 months ago

2.9.0

10 months ago

2.7.0

10 months ago

2.8.0

10 months ago

2.5.0

10 months ago

2.4.0

10 months ago

2.3.1

10 months ago

2.6.1

10 months ago

2.6.0

10 months ago

2.6.2

10 months ago

2.3.0

11 months ago

2.2.0

11 months ago

2.0.3

11 months ago

2.1.0

11 months ago

2.0.2

11 months ago

2.0.1

11 months ago

2.0.0

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

1 year ago