UNPKG

1.46 kBJavaScriptView Raw
1const PropTypes = require('prop-types')
2const UppyCore = require('@uppy/core').Uppy
3
4// The `uppy` prop receives the Uppy core instance.
5const uppy = PropTypes.instanceOf(UppyCore).isRequired
6
7// A list of plugins to mount inside this component.
8const plugins = PropTypes.arrayOf(PropTypes.string)
9
10// Language strings for this component.
11const locale = PropTypes.shape({
12 strings: PropTypes.object,
13 pluralize: PropTypes.func
14})
15
16// List of meta fields for the editor in the Dashboard.
17const metaField = PropTypes.shape({
18 id: PropTypes.string.isRequired,
19 name: PropTypes.string.isRequired,
20 placeholder: PropTypes.string
21})
22const metaFields = PropTypes.arrayOf(metaField)
23
24// A size in pixels (number) or with some other unit (string).
25const cssSize = PropTypes.oneOfType([
26 PropTypes.string,
27 PropTypes.number
28])
29
30// Common props for dashboardy components (Dashboard and DashboardModal).
31const dashboard = {
32 uppy,
33 inline: PropTypes.bool,
34 plugins,
35 width: cssSize,
36 height: cssSize,
37 showProgressDetails: PropTypes.bool,
38 hideUploadButton: PropTypes.bool,
39 hideProgressAfterFinish: PropTypes.bool,
40 note: PropTypes.string,
41 metaFields,
42 proudlyDisplayPoweredByUppy: PropTypes.bool,
43 disableStatusBar: PropTypes.bool,
44 disableInformer: PropTypes.bool,
45 disableThumbnailGenerator: PropTypes.bool,
46 // pass-through to ThumbnailGenerator
47 thumbnailWidth: PropTypes.number,
48 locale
49}
50
51module.exports = {
52 uppy,
53 locale,
54 dashboard
55}