packages/netlify-cms-media-library-uploadcare/src/index.js
function openDialog(files, config, handleInsert) {
  uploadcare.openDialog(files, config).done(({ promise }) =>
    promise().then(({ cdnUrl, count }) => {
      if (config.multiple) {
        const urls = Array.from({ length: count }, (val, idx) => `${cdnUrl}nth/${idx}/`);
        handleInsert(urls);
      } else {
        handleInsert(cdnUrl);
      }
    }),
  );
}
function openDialog(files, config, handleInsert) {
  uploadcare.openDialog(files, config).done(({ promise }) =>
    promise().then(({ cdnUrl, count }) => {
      if (config.multiple) {
        const urls = Array.from({ length: count }, (val, idx) => `${cdnUrl}nth/${idx}/`);
        handleInsert(urls);
      } else {
        handleInsert(cdnUrl);
      }
    }),
  );
}
function openDialog ( files , config , handleInsert ) { uploadcare . openDialog ( files , config ) . done ( ( { promise } ) => promise ( ) . then ( ( { cdnUrl , count } ) => { if ( config . multiple ) { const urls = Array . from ( { length : count } , ( val , idx ) => ` ${ cdnUrl } ${ idx } ` ) ; handleInsert ( urls ) ; } else { handleInsert ( cdnUrl ) ; } } ) , ) ; }
Open the standalone dialog. A single instance is created and destroyed for
each use.
Open the standalone dialog . A single instance is created and destroyed for each use .