propTypes.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const PropTypes = require('prop-types')
  2. const UppyCore = require('../core').Uppy
  3. // The `uppy` prop receives the Uppy core instance.
  4. const uppy = PropTypes.instanceOf(UppyCore).isRequired
  5. // A list of plugins to mount inside this component.
  6. const plugins = PropTypes.arrayOf(PropTypes.string)
  7. // Language strings for this component.
  8. const locale = PropTypes.shape({
  9. strings: PropTypes.object,
  10. pluralize: PropTypes.func
  11. })
  12. // List of meta fields for the editor in the Dashboard.
  13. const metaField = PropTypes.shape({
  14. id: PropTypes.string.isRequired,
  15. name: PropTypes.string.isRequired,
  16. placeholder: PropTypes.string
  17. })
  18. const metaFields = PropTypes.arrayOf(metaField)
  19. // Common props for dashboardy components (Dashboard and DashboardModal).
  20. const dashboard = {
  21. uppy,
  22. inline: PropTypes.bool,
  23. width: PropTypes.number,
  24. height: PropTypes.number,
  25. showProgressDetails: PropTypes.bool,
  26. hideUploadButton: PropTypes.bool,
  27. note: PropTypes.string,
  28. plugins,
  29. locale,
  30. metaFields
  31. }
  32. module.exports = {
  33. uppy,
  34. dashboard
  35. }