diff --git a/bp-attachments/bp-attachments-templates.php b/bp-attachments/bp-attachments-templates.php index b7b7fe8..59c3557 100644 --- a/bp-attachments/bp-attachments-templates.php +++ b/bp-attachments/bp-attachments-templates.php @@ -223,7 +223,7 @@ function bp_attachments_medium_get_owner_avatar() { 'width' => '45', 'height' => '45', 'html' => true, - /* translators: %s: member name */ + /* translators: %s is the displayed User full name */ 'alt' => sprintf( __( 'Profile picture of %s', 'bp-attachments' ), bp_core_get_user_displayname( $medium->owner_id ) ), ) ); diff --git a/bp-attachments/classes/class-bp-attachments-component.php b/bp-attachments/classes/class-bp-attachments-component.php index 502725b..280d58a 100644 --- a/bp-attachments/classes/class-bp-attachments-component.php +++ b/bp-attachments/classes/class-bp-attachments-component.php @@ -338,7 +338,7 @@ public function setup_title() { 'item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf( - /* translators: %s is the Displayed User full name */ + /* translators: %s is the displayed User full name */ __( 'Profile picture of %s', 'bp-attachments' ), bp_get_displayed_user_fullname() ), diff --git a/bp-attachments/js/media-library/index.js.map b/bp-attachments/js/media-library/index.js.map index f98df33..7eff75f 100644 --- a/bp-attachments/js/media-library/index.js.map +++ b/bp-attachments/js/media-library/index.js.map @@ -1 +1 @@ -{"mappings":"uGAKQ,MAAMA,EAAY,iB,w9BCF1B,MACCC,MAAMC,GACLA,IAEEC,IAKEC,OAAEA,GAAWC,OAENC,EAAwB,CAAEC,EAAMC,KAC5C,IAAIC,EAAUL,EAAQG,EAAM,CAAEG,GAAIF,IAOlC,OALAC,EAAQE,SAAWC,IAClB,MAAMC,EAAeP,EAAuBC,EAAMK,EAAOA,QACzDH,EAAU,IAAKA,KAAYI,EAA3B,IAGMJ,CAAP,EAGYK,EAAgBC,IAC5B,MAAMC,EAAQ,CACbd,EAAI,QAAS,kBACbA,EAAI,KAAM,kBACVA,EAAI,KAAM,kBACVA,EAAI,KAAM,kBACVA,EAAI,KAAM,mBAGX,GAAe,IAAVa,EACJ,MAAO,KAAOC,E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CC,GAAC/H,GAAD,MACA+H,GAACvF,GAFD,CAEqBC,YAAczS,IACnC+X,GAACpB,GADD,CACkBlE,YAAczS,IAChC+X,GAACZ,GADD,CACoBvX,SAAWkY,IAPjC,EAYDH,IAAU,WACT,MAAM/X,EAAW6K,OAAOC,mCAAqC,GAC7DkN,GAAQG,GAACE,GAATL,CAAsBhY,SAAWA,IAAc2U,SAASC,cAAe,qB","sources":["src/media-library/store/constants.js","src/media-library/utils/functions.js","src/media-library/store/selectors.js","src/media-library/store/action-types.js","src/media-library/store/actions.js","src/media-library/store/resolvers.js","src/media-library/store/reducers.js","src/media-library/store/controls.js","src/media-library/store/index.js","src/media-library/elements/header.js","src/media-library/elements/uploader.js","src/media-library/elements/directory-creator.js","src/media-library/elements/edit-item.js","src/media-library/elements/toolbar.js","src/media-library/utils/set-template.js","src/media-library/elements/item.js","src/media-library/elements/notices.js","src/media-library/elements/main.js","src/media-library/elements/footer.js","src/media-library/index.js"],"sourcesContent":["/**\n * Identifier key for this store reducer.\n *\n * @type {string}\n */\n export const STORE_KEY = 'bp/attachments';\n","/**\n * WordPress dependencies\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * External dependencies\n */\nconst { filter } = lodash;\n\nexport const getDirectoryAncestors = ( tree, parentId ) => {\n\tlet parents = filter( tree, { id: parentId } );\n\n\tparents.forEach( ( parent ) => {\n\t\tconst grandParents = getDirectoryAncestors( tree, parent.parent );\n\t\tparents = [ ...parents, ...grandParents ];\n\t} );\n\n\treturn parents;\n}\n\nexport const bytesToSize = ( bytes ) => {\n\tconst sizes = [\n\t\t__( 'Bytes', 'bp-attachments' ),\n\t\t__( 'KB', 'bp-attachments' ),\n\t\t__( 'MB', 'bp-attachments' ),\n\t\t__( 'GB', 'bp-attachments' ),\n\t\t__( 'TB', 'bp-attachments' ),\n\t];\n\n\tif ( bytes === 0 ) {\n\t\treturn '0 ' + sizes[0];\n\t}\n\n\tconst i = parseInt( Math.floor( Math.log( bytes ) / Math.log( 1024 ) ), 10 );\n\n\tif ( i === 0 ) {\n\t\treturn `${bytes} ${sizes[i]}`;\n\t}\n\n\treturn `${ ( bytes / ( 1024 ** i ) ).toFixed( 1 ) } ${ sizes[ i ] }`;\n}\n\nexport default bytesToSize;\n","/**\n * External dependencies.\n */\nconst {\n\ttrim,\n\tgroupBy,\n\tfilter,\n\tindexOf,\n\tfind,\n\tdefaultTo,\n} = lodash;\n\n/**\n * Internal dependencies.\n */\nimport { getDirectoryAncestors } from '../utils/functions';\n\n/**\n * Returns the Community Media Library settings.\n *\n * @param {Object} state\n * @returns {Object} The Community Media Library settings.\n */\nexport const getSettings = ( state ) => {\n\tconst { settings } = state;\n\treturn settings;\n}\n\n/**\n * Returns the requests context.\n *\n * @param {Object} state\n * @returns {string} The requests context (`edit` or `view`).\n */\nexport const getRequestsContext = ( state ) => {\n\tconst {\n\t\tsettings: {\n\t\t\tisAdminScreen,\n\t\t}\n\t} = state;\n\n\treturn true === isAdminScreen ? 'edit' : 'view';\n}\n\n/**\n * Returns whether the display mode is Grid or not.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if the display mode is Grid. False otherwise.\n */\nexport const isGridDisplayMode = ( state ) => {\n\tconst { isGrid } = state;\n\treturn isGrid;\n}\n\n/**\n * Returns the logged in user Object.\n *\n * @param {Object} state The current state.\n * @return {Object} The logged in user Object.\n */\nexport const getLoggedInUser = ( state ) => {\n\tconst { user } = state;\n\treturn user;\n};\n\n/**\n * Returns the displayed user ID.\n *\n * @param {Object} state The current state.\n * @return {integer} The displayed user ID.\n */\nexport const getDisplayedUserId = ( state ) => {\n\tconst { displayedUserId } = state;\n\treturn displayedUserId;\n};\n\n/**\n * Returns whether the display mode is Grid or not.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if the display mode is Grid. False otherwise.\n */\nexport const getFormState = ( state ) => {\n\tconst { formState } = state;\n\treturn formState || {};\n}\n\n/**\n * Returns whether an upload is being processed.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if an upload is being processed. False otherwise.\n */\nexport const isUploading = ( state ) => {\n\tconst { uploading } = state;\n\treturn uploading;\n};\n\n/**\n * Returns whether a query is being processed.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if a query is being processed. False otherwise.\n */\n export const isQuerying = ( state ) => {\n\tconst { querying } = state;\n\treturn querying;\n};\n\n/**\n * Returns whether an upload has been processed.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if an uploads has been processed. False otherwise.\n */\n export const uploadEnded = ( state ) => {\n\tconst { ended } = state;\n\treturn ended;\n};\n\n/**\n * Returns the list of uploaded file Objects.\n *\n * @param {Object} state The current state.\n * @return {array} The list of uploaded file Objects.\n */\nexport const getUploads = ( state ) => {\n\tconst { uploads } = state;\n\treturn uploads;\n};\n\n/**\n * Returns the list of errors.\n *\n * @param {Object} state The current state.\n * @return {array} The list of errors.\n */\nexport const getErrors = ( state ) => {\n\tconst { errors } = state;\n\treturn errors;\n};\n\n/**\n * Returns the community media objects list.\n *\n * @param {Object} state The current state.\n * @return {array} The list of community media objects.\n */\nexport const getMedia = ( state ) => {\n\tconst { files } = state;\n\treturn files;\n};\n\n/**\n * Returns the number of community media objects.\n *\n * @param {Object} state The current state.\n * @return {integer} The list of community media objects.\n */\nexport const countMedia = ( state ) => {\n\tconst { files } = state;\n\treturn files.length;\n};\n\n/**\n * Returns the current directory.\n *\n * @param {Object} state The current state.\n * @return {string} The current directory.\n */\nexport const getCurrentDirectory = ( state ) => {\n\tconst { currentDirectory } = state;\n\treturn currentDirectory || '';\n};\n\n/**\n * Returns the current directory object.\n *\n * @param {Object} state The current state.\n * @return {Object} The current directory object.\n */\n export const getCurrentDirectoryObject = ( state ) => {\n\tconst { currentDirectory, tree } = state;\n\tconst defaultValue = { readonly: true };\n\n\tif ( '' !== currentDirectory ) {\n\t\treturn defaultTo(\n\t\t\tfind( tree, { id: currentDirectory } ),\n\t\t\tdefaultValue\n\t\t);\n\t}\n\n\treturn defaultValue;\n};\n\n/**\n * Returns the directories Tree.\n *\n * @param {Object} state The current state.\n * @return {array} The directories Tree.\n */\n export const getTree = ( state ) => {\n\tconst { tree, currentDirectory } = state;\n\tconst groupedTree = groupBy( tree, 'parent' );\n\tconst currentChildrenIds = filter( tree, { 'parent': currentDirectory || 0 } ).map( ( child ) => child.id );\n\n\t// Makes sure to only list current directory children.\n\tif ( currentChildrenIds && currentChildrenIds.length ) {\n\t\tcurrentChildrenIds.forEach( ( childId ) => {\n\t\t\tif ( groupedTree[ childId ] ) {\n\t\t\t\tdelete groupedTree[ childId ];\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Makes sure to avoid listing children of directories that are not an ancestor of the currentDirectory one.\n\tif ( currentDirectory ) {\n\t\tconst currentAncestors = getDirectoryAncestors(\n\t\t\ttree,\n\t\t\tcurrentDirectory\n\t\t).map( ( ancestor ) => ancestor.id );\n\n\t\tObject.keys( groupedTree ).forEach( ( treeIndex ) => {\n\t\t\tif ( 0 !== parseInt( treeIndex, 10 ) && -1 === indexOf( currentAncestors, treeIndex ) ) {\n\t\t\t\tdelete groupedTree[ treeIndex ];\n\t\t\t}\n\t\t} );\n\t}\n\n\tconst fillWithChildren = ( items ) => {\n\t\treturn items.map( ( item ) => {\n\t\t\tconst children = groupedTree[ item.id ];\n\t\t\treturn {\n\t\t\t\t...item,\n\t\t\t\tchildren: children && children.length ?\n\t\t\t\t\tfillWithChildren( children ) :\n\t\t\t\t\t[],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( groupedTree[0] || [] );\n};\n\n/**\n * Returns the directory flat list.\n *\n * @param {Object} state The current state.\n * @return {array} The directory flat list.\n */\n export const getFlatTree = ( state ) => {\n\tconst { tree } = state;\n\treturn tree || [];\n};\n\n/**\n * Returns whether a media/directory item is selectable.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if a media/directory item is selectable. False otherwise.\n */\nexport const isSelectable = ( state ) => {\n\tconst { isSelectable } = state;\n\treturn isSelectable;\n};\n\n/**\n * Returns the selected media.\n *\n * @param {Object} state The current state.\n * @return {array} The list of selected media.\n */\nexport const selectedMedia = ( state ) => {\n\tconst { files } = state;\n\n\treturn filter( files, [ 'selected', true ] );\n}\n\n/**\n * Returns the current relative path.\n *\n * @param {Object} state The current state.\n * @return {string} The current relative path.\n */\nexport const getRelativePath = ( state ) => {\n\tconst { relativePath } = state;\n\treturn relativePath;\n};\n\n/**\n * Returns the destination data for media.\n *\n * @param {Object} state The current state.\n * @return {Object} The destination data for media.\n */\nexport const getDestinationData = ( state ) => {\n\tconst { relativePath } = state;\n\n\tif ( ! relativePath ) {\n\t\treturn {\n\t\t\tobject: 'members',\n\t\t}\n\t}\n\n\tconst destinationData = trim( relativePath, '/' ).split( '/' );\n\n\treturn {\n\t\tvisibility: destinationData[0] ? destinationData[0] : 'public',\n\t\tobject: destinationData[1] ? destinationData[1] : 'members',\n\t\titem: destinationData[2] ? destinationData[2] : '',\n\t}\n};\n\n/**\n * Returns the Member Media Libraries pagination data.\n *\n * @param {Object} state The current state.\n * @return {Object} The Member Media Libraries pagination data.\n */\nexport const getPagination = ( state ) => {\n\tconst { pagination } = state;\n\treturn pagination;\n};\n","export const TYPES = {\n\tSET_SETTINGS: 'SET_SETTINGS',\n\tGET_LOGGED_IN_USER: 'GET_LOGGED_IN_USER',\n\tSET_DISPLAYED_USER_ID: 'SET_DISPLAYED_USER_ID',\n\tGET_MEDIA: 'GET_MEDIA',\n\tADD_MEDIUM: 'ADD_MEDIUM',\n\tFILL_TREE: 'FILL_TREE',\n\tPURGE_TREE: 'PURGE_TREE',\n\tREMOVE_MEDIUM: 'REMOVE_MEDIUM',\n\tFETCH_FROM_API: 'FETCH_FROM_API',\n\tGET_FROM_API: 'GET_FROM_API',\n\tCREATE_FROM_API: 'CREATE_FROM_API',\n\tUPDATE_FROM_API: 'UPDATE_FROM_API',\n\tDELETE_FROM_API: 'DELETE_FROM_API',\n\tUPLOAD_START: 'UPLOAD_START',\n\tUPLOAD_END: 'UPLOAD_END',\n\tRESET_UPLOADS: 'RESET_UPLOADS',\n\tADD_ERROR: 'ADD_ERROR',\n\tREMOVE_ERROR: 'REMOVE_ERROR',\n\tTOGGLE_SELECTABLE: 'TOGGLE_SELECTABLE',\n\tTOGGLE_MEDIA_SELECTION: 'TOGGLE_MEDIA_SELECTION',\n\tSWITCH_DISPLAY_MODE: 'SWITCH_DISPLAY_MODE',\n\tUPDATE_FORM_STATE: 'UPDATE_FORM_STATE',\n\tSET_QUERY_STATUS: 'SET_QUERY_STATUS',\n};\n","/**\n * External dependencies.\n */\n const {\n\tuniqueId,\n\thasIn,\n\ttrim,\n\ttrimEnd,\n\tfilter,\n} = lodash;\n\n/**\n * WordPress dependencies.\n */\nconst {\n\tdata: {\n\t\tdispatch,\n\t\tselect,\n\t},\n\turl: {\n\t\taddQueryArgs,\n\t}\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { TYPES as types } from './action-types';\nimport { STORE_KEY } from './constants';\n\n/**\n * Returns an action to set the BP attachments Media Library settings.\n *\n * @param {Object} settings The settings to use.\n * @return {Object} Object for action.\n */\nexport function setSettings( settings ) {\n\treturn {\n\t\ttype: types.SET_SETTINGS,\n\t\tsettings,\n\t};\n};\n\n/**\n * Returns an action object used to fetch media from the API.\n *\n * @param {string} path Endpoint path.\n * @param {boolean} parse Should we parse the request.\n * @return {Object} Object for action.\n */\nexport function fetchFromAPI( path, parse ) {\n\treturn {\n\t\ttype: types.FETCH_FROM_API,\n\t\tpath,\n\t\tparse,\n\t};\n};\n\n/**\n * Returns an action object used to get media from the API.\n *\n * @param {Promise} response the API respose.\n * @return {Object} Object for action.\n */\nexport function getFromAPI( response ) {\n\treturn {\n\t\ttype: types.GET_FROM_API,\n\t\tresponse,\n\t};\n};\n\n/**\n * Returns an action object used to create media via the API.\n *\n * @param {string} path Endpoint path.\n * @param {Object} data The data to be created.\n * @return {Object} Object for action.\n */\nexport function createFromAPI( path, data ) {\n\treturn {\n\t\ttype: types.CREATE_FROM_API,\n\t\tpath,\n\t\tdata,\n\t};\n};\n\n/**\n * Returns an action object used to update media via the API.\n *\n * @param {string} path Endpoint path.\n * @param {Object} data The data to be updated.\n * @return {Object} Object for action.\n */\n export function updateFromAPI( path, data ) {\n\treturn {\n\t\ttype: types.UPDATE_FROM_API,\n\t\tpath,\n\t\tdata,\n\t};\n};\n\n/**\n * Returns an action object used to delete a media via the API.\n *\n * @param {string} path Endpoint path.\n * @param {Object} data The data to be created.\n * @param {integer} totalBytes The total amount of bytes per delete batches.\n * @return {Object} Object for action.\n */\nexport function deleteFromAPI( path, relativePath, totalBytes ) {\n\treturn {\n\t\ttype: types.DELETE_FROM_API,\n\t\tpath,\n\t\trelativePath,\n\t\ttotalBytes,\n\t};\n};\n\n/**\n * Returns an action object used to switch between Grid & List mode.\n *\n * @param {Boolean} isGrid\n * @returns {Object} Object for action.\n */\nexport function switchDisplayMode( isGrid ) {\n\treturn {\n\t\ttype: types.SWITCH_DISPLAY_MODE,\n\t\tisGrid,\n\t};\n};\n\n/**\n * Returns an action object used to get the logged in user.\n *\n * @param {Object} user Logged In User object.\n * @return {Object} Object for action.\n */\nexport function getLoggedInUser( user ) {\n\treturn {\n\t\ttype: types.GET_LOGGED_IN_USER,\n\t\tuser,\n\t};\n};\n\n/**\n * Returns an action object used to set the displayed user id.\n *\n * @param {integer} userId Displayed user ID.\n * @return {Object} Object for action.\n */\nexport function setDisplayedUserId( userId ) {\n\treturn {\n\t\ttype: types.SET_DISPLAYED_USER_ID,\n\t\tuserId,\n\t};\n};\n\n/**\n * Returns an action object used to get media.\n *\n * @param {Array} files The list of files.\n * @param {String} relativePath The relative path.\n * @param {Object} currentDirectory The current directory.\n * @return {Object} Object for action.\n */\nexport function getMedia( files, relativePath, currentDirectory, pagination ) {\n\treturn {\n\t\ttype: types.GET_MEDIA,\n\t\tfiles,\n\t\trelativePath,\n\t\tcurrentDirectory,\n\t\tpagination,\n\t};\n};\n\n/**\n * Returns an action object used to update the Upload/Directory Form state.\n *\n * @param {Object} params\n * @returns {Object} Object for action.\n */\nexport function updateFormState( params ) {\n\treturn {\n\t\ttype: types.UPDATE_FORM_STATE,\n\t\tparams,\n\t};\n};\n\n/**\n * Prepare a directory to be added to the Tree.\n *\n * @param {Object} directory The medium object.\n * @param {string} parent The parent ID.\n * @returns {Object} The item Tree.\n */\nconst setItemTree = ( directory, parent ) => {\n\tconst itemTree = {\n\t\tid: directory.id,\n\t\tslug: directory.name,\n\t\tname: directory.title,\n\t\tparent: parent,\n\t\tobject: directory.object ? directory.object : 'members',\n\t\treadonly: directory.readonly ? directory.readonly : false,\n\t\tvisibility: directory.visibility ? directory.visibility : 'public',\n\t\ttype: directory.media_type ? directory.media_type : 'folder',\n\t}\n\n\treturn itemTree;\n};\n\n/**\n * Init the directories Tree.\n *\n * @param {array} items The list of media.\n */\nexport function initTree( items ) {\n\tconst tree = select( STORE_KEY ).getTree();\n\tconst directories = filter( items, { 'mime_type': 'inode/directory' } );\n\n\tif ( ! tree.length ) {\n\t\tdirectories.forEach( ( item ) => {\n\t\t\tconst itemTree = setItemTree( item, 0 );\n\t\t\tdispatch( STORE_KEY ).addItemTree( itemTree );\n\t\t} );\n\t}\n};\n\n/**\n * Returns an action object used to add a directory item to the Items tree.\n *\n * @param {Object} item A media item.\n * @return {Object} Object for action.\n */\nexport function addItemTree( item ) {\n\treturn {\n\t\ttype: types.FILL_TREE,\n\t\titem,\n\t};\n};\n\n/**\n * Returns an action object used to remove a directory item from the Items tree.\n *\n * @param {string} itemId A media item ID.\n * @return {Object} Object for action.\n */\n export function removeItemTree( itemId ) {\n\treturn {\n\t\ttype: types.PURGE_TREE,\n\t\titemId,\n\t};\n};\n\n/**\n * Returns an action object used to switch between Selectable & Regular mode.\n *\n * @param {boolean} isSelectable True to switch to Selectable mode. False otherwise.\n * @returns {Object} Object for action.\n */\nexport function toggleSelectable( isSelectable ) {\n\treturn {\n\t\ttype: types.TOGGLE_SELECTABLE,\n\t\tisSelectable,\n\t};\n};\n\n/**\n * Returns an action object used to switch between Selectable & Regular mode.\n *\n * @param {array} ids The list of media ID.\n * @param {boolean} isSelected True if the media is selected. False otherwise.\n * @returns {Object} Object for action.\n */\nexport function toggleMediaSelection( ids, isSelected ) {\n\treturn {\n\t\ttype: types.TOGGLE_MEDIA_SELECTION,\n\t\tids,\n\t\tisSelected,\n\t};\n};\n\n/**\n * Returns an action object used to add a new file to the Media list.\n *\n * @param {object} file The uploaded medium.\n * @returns {Object} Object for action.\n */\nexport function addMedium( file ) {\n\treturn {\n\t\ttype: types.ADD_MEDIUM,\n\t\tfile,\n\t};\n};\n\n/**\n * Returns an action object used to add a new error.\n *\n * @param {object} error The uploaded file which errored.\n * @returns {Object} Object for action.\n */\nexport function addMediumError( error ) {\n\treturn {\n\t\ttype: types.ADD_ERROR,\n\t\terror,\n\t};\n};\n\n/**\n * Creates a Medium uploading a file.\n *\n * @param {Object} file The file object to upload.\n * @param {integer} totalBytes The total amount of bytes per upload batches.\n * @returns {Object} Object for action.\n */\nexport function * createMedium( file, totalBytes ) {\n\tlet uploading = true, upload;\n\tconst store = select( STORE_KEY );\n\tconst { object, item, visibility } = store.getDestinationData();\n\tconst relativePath = store.getRelativePath();\n\n\tyield { type: 'UPLOAD_START', uploading, file };\n\n\tconst formData = new FormData();\n\tformData.append( 'file', file );\n\tformData.append( 'action', 'bp_attachments_media_upload' );\n\tformData.append( 'object', object );\n\tformData.append( 'object_item', item );\n\n\tif ( visibility ) {\n\t\tformData.append( 'visibility', visibility );\n\t}\n\n\tif ( totalBytes ) {\n\t\tformData.append( 'total_bytes', totalBytes );\n\t}\n\n\tif ( trim( relativePath, '/' ) !== visibility + '/' + object + '/' + item ) {\n\t\tlet uploadRelativePath = relativePath;\n\n\t\t// Private uploads are stored out of the site's uploads dir.\n\t\tif ( 'private' === visibility ) {\n\t\t\tuploadRelativePath = relativePath.replace( '/private', '' );\n\t\t}\n\n\t\tformData.append( 'parent_dir', uploadRelativePath );\n\t}\n\n\tuploading = false;\n\ttry {\n\t\tupload = yield createFromAPI( '/buddypress/v1/attachments', formData );\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\n\t\treturn addMedium( upload );\n\t} catch ( error ) {\n\t\tupload = {\n\t\t\tid: uniqueId(),\n\t\t\tname: file.name,\n\t\t\terror: error.message,\n\t\t\tuploaded: false,\n\t\t};\n\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\n\t\treturn addMediumError( upload );\n\t}\n};\n\n/**\n * Creates a new directory, photo album, audio or video playluist.\n *\n * @todo to avoid too much code duplication, createDirectory & createMedium should probably be\n * gathered into one function.\n *\n * @param {Object} directory The data to use create the directory\n * @returns {Object} Object for action.\n */\nexport function * createDirectory( directory ) {\n\tlet uploading = true, upload;\n\n\t// A directory is handled as a file having the inode/directory mime type.\n\tlet file = {\n\t\tname: directory.directoryName,\n\t\ttype: directory.directoryType,\n\t};\n\n\tconst store = select( STORE_KEY );\n\tconst { object, item, visibility } = store.getDestinationData();\n\tconst relativePath = store.getRelativePath();\n\n\tyield { type: 'UPLOAD_START', uploading, file };\n\n\tconst formData = new FormData();\n\tformData.append( 'directory_name', file.name );\n\tformData.append( 'directory_type', file.type );\n\tformData.append( 'action', 'bp_attachments_make_directory' );\n\tformData.append( 'object', object );\n\tformData.append( 'object_item', item );\n\n\tif ( visibility ) {\n\t\tformData.append( 'visibility', visibility );\n\t}\n\n\tif ( trim( relativePath, '/' ) !== visibility + '/' + object + '/' + item ) {\n\t\tlet createDirRelativePath = relativePath;\n\n\t\t// Private uploads are stored out of the site's uploads dir.\n\t\tif ( 'private' === visibility ) {\n\t\t\tcreateDirRelativePath = relativePath.replace( '/private', '' );\n\t\t}\n\n\t\tformData.append( 'parent_dir', createDirRelativePath );\n\t}\n\n\tuploading = false;\n\ttry {\n\t\tupload = yield createFromAPI( '/buddypress/v1/attachments', formData );\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\t\tupload.uploaded = true;\n\n\t\tconst currentDir = store.getCurrentDirectoryObject();\n\t\tconst itemTree = setItemTree( upload, currentDir.id );\n\n\t\t// Add the directory to the tree.\n\t\tyield addItemTree( itemTree );\n\n\t\treturn addMedium( upload );\n\t} catch ( error ) {\n\t\tupload = {\n\t\t\tid: uniqueId(),\n\t\t\tname: file.name,\n\t\t\terror: error.message,\n\t\t\tuploaded: false,\n\t\t};\n\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\n\t\treturn addMediumError( upload );\n\t}\n};\n\n/**\n * Updates a Medium.\n *\n * @param {Object} medium The medium object to update.\n * @returns {Object} Object for action.\n */\nexport function * updateMedium( medium ) {\n\tlet update;\n\tconst store = select( STORE_KEY );\n\tconst relativePath = store.getRelativePath();\n\n\ttry {\n\t\tupdate = yield updateFromAPI(\n\t\t\t'/buddypress/v1/attachments/' + medium.id + '/',\n\t\t\t{\n\t\t\t\t'relative_path': relativePath,\n\t\t\t\ttitle: medium.title,\n\t\t\t\tdescription: medium.description,\n\t\t\t}\n\t\t);\n\n\t\tif ( !! medium.selected ) {\n\t\t\tupdate.selected = true;\n\t\t}\n\n\t\treturn addMedium( update );\n\t} catch ( error ) {\n\t\tupdate = {\n\t\t\tid: uniqueId(),\n\t\t\tname: medium.name,\n\t\t\terror: error.message,\n\t\t\tupdated: false,\n\t\t};\n\n\t\treturn addMediumError( update );\n\t}\n};\n\n/**\n * Parses the request response and edit Media store.\n *\n * @param {Object} response The request response.\n * @param {String} relativePath The relative path of the medium.\n * @param {String} parent The parent directory.\n * @param {Object} pagination The request pagination.\n * @returns {void}\n */\nexport const parseResponseMedia = async ( response, relativePath, parent = '', pagination ) => {\n\tconst items = await response.json().then( ( data ) => {\n\t\tdata.forEach( ( item ) => {\n\t\t\titem.parent = parent;\n\n\t\t\tif ( 'inode/directory' === item.mime_type ) {\n\t\t\t\tconst itemTree = setItemTree( item, 0 === item.id.indexOf( 'member-' ) ? 0 : parent );\n\t\t\t\tdispatch( STORE_KEY ).addItemTree( itemTree );\n\t\t\t}\n\t\t} );\n\n\t\treturn data;\n\t} );\n\n\t// Init the Tree when needed.\n\tif ( ! relativePath && ! parent && 1 === parseInt( pagination.membersPage, 10 ) ) {\n\t\tinitTree( items );\n\t}\n\n\tdispatch( STORE_KEY ).getMedia( items, relativePath, parent, pagination );\n};\n\n/**\n * Requests media according to specific arguments.\n *\n * @param {Object} args The Media request arguments.\n * @returns {void}\n */\nexport function * requestMedia( args = {} ) {\n\tconst path = '/buddypress/v1/attachments';\n\tconst displayedUserId = select( STORE_KEY ).getDisplayedUserId();\n\tlet querying = true;\n\tlet relativePathHeader = '';\n\tlet parent = '';\n\tlet pagination = {};\n\n\tyield { type: 'SET_QUERY_STATUS', querying };\n\n\tif ( ! args.context ) {\n\t\targs.context = select( STORE_KEY ).getRequestsContext();\n\t}\n\n\tif ( args.directory && args.path ) {\n\t\targs.directory = trimEnd( args.path, '/' ) + '/' + args.directory;\n\t}\n\n\tif ( args.parent ) {\n\t\tparent = args.parent;\n\t\tdelete args.parent;\n\t}\n\n\tif ( !! displayedUserId ) {\n\t\targs.user_id = displayedUserId;\n\t}\n\n\tdelete args.path;\n\n\tconst response = yield fetchFromAPI( addQueryArgs( path, args ), false );\n\tquerying = false;\n\n\tif ( hasIn( response, [ 'headers', 'get' ] ) ) {\n\t\t// If the request is fetched using the fetch api, the header can be\n\t\t// retrieved using the 'get' method.\n\t\trelativePathHeader = response.headers.get( 'X-BP-Attachments-Relative-Path' );\n\t\tpagination = {\n\t\t\tmembersDisplayedAmount: response.headers.get( 'X-BP-Attachments-Media-Libraries-Total' ),\n\t\t\ttotalMembersPage: response.headers.get( 'X-BP-Attachments-Media-Libraries-TotalPages' ),\n\t\t};\n\t} else {\n\t\t// If the request was preloaded server-side and is returned by the\n\t\t// preloading middleware, the header will be a simple property.\n\t\trelativePathHeader = get( response, [ 'headers', 'X-BP-Attachments-Relative-Path' ], '' );\n\t\tpagination = {\n\t\t\tmembersDisplayedAmount: get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-Total' ], 0 ),\n\t\t\ttotalMembersPage: get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-TotalPages' ], 0 ),\n\t\t};\n\t}\n\n\tif ( !! pagination.totalMembersPage ) {\n\t\tpagination.membersPage = ! args.page ? 1 : parseInt( args.page, 10 );\n\t}\n\n\tyield { type: 'SET_QUERY_STATUS', querying };\n\treturn parseResponseMedia( response, relativePathHeader, parent, pagination );\n};\n\n/**\n * Returns an action object used to remove a medium from the state.\n *\n * @param {integer} id The medium ID.\n * @returns {Object} Object for action.\n */\nexport function removeMedium( id ) {\n\treturn {\n\t\ttype: 'REMOVE_MEDIUM',\n\t\tid,\n\t}\n};\n\n/**\n * Deletes a Medium removing the file from the server's filesystem.\n *\n * @param {Object} file The file object to upload.\n * @param {integer} totalBytes The total amount of bytes per delete batches.\n * @returns {Object} Object for action.\n */\nexport function * deleteMedium( file, totalBytes ) {\n\tconst store = select( STORE_KEY );\n\tconst relativePath = store.getRelativePath();\n\tlet deleted;\n\n\ttry {\n\t\tdeleted = yield deleteFromAPI( '/buddypress/v1/attachments/' + file.id + '/', relativePath, totalBytes );\n\n\t\tif ( 'inode/directory' === deleted.previous.mime_type ) {\n\t\t\tyield removeItemTree( deleted.previous.id );\n\t\t}\n\n\t\treturn removeMedium( deleted.previous.id );\n\t} catch ( error ) {\n\t\tfile.error = error.message;\n\n\t\treturn addMediumError( file );\n\t}\n};\n\n/**\n * Returns an action object used to remove an error.\n *\n * @param {integer} errorID The error ID.\n * @returns {Object} Object for action.\n */\nexport function removeMediumError( errorID ) {\n\treturn {\n\t\ttype: types.REMOVE_ERROR,\n\t\terrorID,\n\t};\n};\n","/**\n * External dependencies.\n */\nconst {\n\tget,\n\thasIn,\n} = lodash;\n\n/**\n * Internal dependencies.\n */\nimport {\n\tfetchFromAPI,\n\tgetFromAPI,\n\tinitTree,\n\tgetLoggedInUser as getLoggedInUserAction,\n\tgetMedia as getMediaAction,\n} from './actions';\n\n/**\n * Returns the request context.\n *\n * @access private\n * @returns {string} The request context (view or edit).\n */\nconst _requestContext = () => {\n\tconst { isAdminScreen } = window.bpAttachmentsMediaLibrarySettings || {};\n\treturn isAdminScreen && true === isAdminScreen ? 'edit' : 'view';\n};\n\n/**\n * Resolver for retrieving current user.\n */\nexport function* getLoggedInUser() {\n\tconst path = '/buddypress/v1/members/me?context=edit';\n\tconst user = yield fetchFromAPI( path, true );\n\tyield getLoggedInUserAction( user );\n};\n\n/**\n * Resolver for retrieving the current user media library or all user media libraries.\n */\nexport function* getMedia() {\n\tconst path = '/buddypress/v1/attachments?context=' + _requestContext();\n\tconst response = yield fetchFromAPI( path, false );\n\tconst files = yield getFromAPI( response );\n\tlet pagination = {\n\t\tmembersPage: 1,\n\t};\n\n\tif ( hasIn( response, [ 'headers', 'get' ] ) ) {\n\t\tpagination.membersDisplayedAmount = parseInt( response.headers.get( 'X-BP-Attachments-Media-Libraries-Total' ), 10 );\n\t\tpagination.totalMembersPage = parseInt( response.headers.get( 'X-BP-Attachments-Media-Libraries-TotalPages' ), 10 );\n\t} else {\n\t\tpagination.membersDisplayedAmount = parseInt( get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-Total' ], 0 ), 10 );\n\t\tpagination.totalMembersPage = parseInt( get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-TotalPages' ], 0 ), 10 );\n\t}\n\n\tinitTree( files );\n\n\tyield getMediaAction( files, '', '', pagination );\n};\n","/**\n * External dependencies.\n */\n const {\n\treject,\n} = lodash;\n\n/**\n * Internal dependencies\n */\nimport { TYPES as types } from './action-types';\n\n/**\n * Default state.\n */\nconst DEFAULT_STATE = {\n\tuser: {},\n\tdisplayedUserId: 0,\n\ttree: [],\n\tcurrentDirectory: '',\n\tfiles: [],\n\trelativePath: '',\n\tuploads: [],\n\terrors: [],\n\tuploading: false,\n\tended: false,\n\tisSelectable: false,\n\tisGrid: true,\n\tsettings: {},\n\tformState: {},\n\tpagination: {\n\t\tmembersPage: 1,\n\t\tmembersDisplayedAmount: 0,\n\t\ttotalMembersPage: 0,\n\t},\n\tquerying: false,\n};\n\n/**\n * Reducer for the BP Attachments Library.\n *\n * @param {Object} state The current state in the store.\n * @param {Object} action Action object.\n *\n * @return {Object} New or existing state.\n */\n const reducer = ( state = DEFAULT_STATE, action ) => {\n\tswitch ( action.type ) {\n\t\tcase types.SET_SETTINGS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tsettings: action.settings,\n\t\t\t};\n\n\t\tcase types.GET_LOGGED_IN_USER:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuser: action.user,\n\t\t\t};\n\n\t\tcase types.SET_DISPLAYED_USER_ID:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tdisplayedUserId: parseInt( action.userId, 10 ),\n\t\t\t};\n\n\t\tcase types.GET_MEDIA:\n\t\t\tlet media = [];\n\t\t\tif ( action.pagination.membersPage && 1 < action.pagination.membersPage ) {\n\t\t\t\tmedia = [ ...state.files, ...action.files ];\n\t\t\t} else {\n\t\t\t\tmedia = action.files;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: media,\n\t\t\t\trelativePath: action.relativePath,\n\t\t\t\tcurrentDirectory: action.currentDirectory,\n\t\t\t\tpagination: {\n\t\t\t\t\t...action.pagination\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase types.FILL_TREE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttree: [\n\t\t\t\t\t...reject( state.tree, [ 'id', action.item.id ] ),\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.PURGE_TREE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttree: reject( state.tree, [ 'id', action.itemId ] ),\n\t\t\t};\n\n\t\tcase types.UPDATE_FORM_STATE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tformState: {\n\t\t\t\t\t...action.params\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase types.ADD_MEDIUM:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: [\n\t\t\t\t\t...reject( state.files, [ 'id', action.file.id ] ),\n\t\t\t\t\taction.file,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.UPLOAD_START:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuploading: action.uploading,\n\t\t\t\tuploads: [\n\t\t\t\t\t...state.uploads,\n\t\t\t\t\taction.file,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.ADD_ERROR:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\terrors: [\n\t\t\t\t\t...state.errors,\n\t\t\t\t\taction.error,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.REMOVE_ERROR:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\terrors: reject( state.errors, [ 'id', action.errorID ] ),\n\t\t\t};\n\n\t\tcase types.UPLOAD_END:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuploading: action.uploading,\n\t\t\t\tuploads: reject( state.uploads, ( u ) => { return u.name === action.file.name; } ),\n\t\t\t\tended: true,\n\t\t\t};\n\n\t\tcase types.RESET_UPLOADS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuploading: false,\n\t\t\t\tuploads: [],\n\t\t\t\terrors:[],\n\t\t\t\tended: false,\n\t\t\t};\n\n\t\tcase types.TOGGLE_SELECTABLE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisSelectable: action.isSelectable,\n\t\t\t};\n\n\t\tcase types.TOGGLE_MEDIA_SELECTION:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: state.files.map( file => {\n\t\t\t\t\tif ( ( 'all' === action.ids[0] && ! action.isSelected ) || ( -1 !== action.ids.indexOf( file.id ) ) ) {\n\t\t\t\t\t\tfile.selected = action.isSelected;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t\t} ),\n\t\t\t};\n\n\t\tcase types.SWITCH_DISPLAY_MODE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisGrid: action.isGrid,\n\t\t\t};\n\n\t\tcase types.REMOVE_MEDIUM:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: [\n\t\t\t\t\t...reject( state.files, [ 'id', action.id ] )\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.SET_QUERY_STATUS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tquerying: action.querying,\n\t\t\t};\n\t}\n\n\treturn state;\n};\n\nexport default reducer;\n","/**\n * WordPress dependencies.\n */\nconst {\n\tapiFetch,\n} = wp;\n\n/**\n * Default export for registering the controls with the store.\n *\n * @return {Object} An object with the controls to register with the store on\n * the controls property of the registration object.\n */\nexport const controls = {\n\tFETCH_FROM_API( { path, parse } ) {\n\t\treturn apiFetch( { path, parse } );\n\t},\n\tGET_FROM_API( { response } ) {\n\t\treturn response.json();\n\t},\n\tCREATE_FROM_API( { path, data } ) {\n\t\treturn apiFetch(\n\t\t\t{\n\t\t\t\tpath: path,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: data\n\t\t\t}\n\t\t);\n\t},\n\tUPDATE_FROM_API( { path, data } ) {\n\t\treturn apiFetch(\n\t\t\t{\n\t\t\t\tpath: path,\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tdata: data\n\t\t\t}\n\t\t);\n\t},\n\tDELETE_FROM_API( { path, relativePath, totalBytes } ) {\n\t\treturn apiFetch(\n\t\t\t{\n\t\t\t\tpath: path,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\tdata: {\n\t\t\t\t\trelative_path: relativePath,\n\t\t\t\t\ttotal_bytes: totalBytes,\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n};\n","/**\n * WordPress dependencies.\n */\n const {\n\tdata: {\n\t\tregisterStore,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { STORE_KEY } from './constants';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\nimport reducer from './reducers';\nimport { controls } from './controls';\n\nregisterStore( STORE_KEY, {\n\treducer,\n\tactions,\n\tselectors,\n\tcontrols,\n\tresolvers,\n} );\n\nexport const BP_ATTACHMENTS_STORE_KEY = STORE_KEY;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tPopover,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Header element.\n */\nconst MediaLibraryHeader = ( { settings } ) => {\n\tconst { updateFormState } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst {\n\t\tcurrentDirectoryObject,\n\t\tuser,\n\t\tdisplayedUserId,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tcurrentDirectoryObject: store.getCurrentDirectoryObject(),\n\t\t\tuser: store.getLoggedInUser(),\n\t\t\tdisplayedUserId: store.getDisplayedUserId(),\n\t\t};\n\t}, [] );\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst toggleClass = true === isOpen ? 'split-button is-open' : 'split-button';\n\tconst dashiconClass = true === isOpen ? 'dashicons dashicons-arrow-up-alt2' : 'dashicons dashicons-arrow-down-alt2';\n\tconst canUpload = true !== currentDirectoryObject.readonly && ( ! displayedUserId || displayedUserId === user.id );\n\tconst { allowedExtByMediaList, isAdminScreen } = settings;\n\tconst hrClass = isAdminScreen ? 'wp-header-end' : 'screen-header-end';\n\tconst pageTitle = !! user.capabilities && -1 !== user.capabilities.indexOf( 'bp_moderate' ) ? __( 'Community Media Libraries', 'bp-attachments' ) : __( 'Community Media Library', 'bp-attachments' );\n\n\tconst showUploadForm = ( e ) => {\n\t\te.preventDefault();\n\n\t\treturn updateFormState(\n\t\t\t{\n\t\t\t\tparentDirectory: currentDirectoryObject.id,\n\t\t\t\taction: 'upload',\n\t\t\t}\n\t\t);\n\t};\n\n\tconst showCreateDirForm = ( e, type ) => {\n\t\te.preventDefault();\n\n\t\treturn updateFormState(\n\t\t\t{\n\t\t\t\tparentDirectory: currentDirectoryObject.id,\n\t\t\t\taction: 'createDirectory',\n\t\t\t\tdirectoryType: type,\n\t\t\t}\n\t\t);\n\t};\n\n\tlet dirOptions = [];\n\tconst directoryTypes = [ 'album', 'audio_playlist', 'video_playlist' ];\n\n\tif ( ! currentDirectoryObject.type || -1 === directoryTypes.indexOf( currentDirectoryObject.type ) ) {\n\t\tdirOptions = [\n\t\t\t{\n\t\t\t\tid: 'folder',\n\t\t\t\ttext: __( 'Add new directory', 'bp-attachments' ),\n\t\t\t}\n\t\t];\n\n\t\tif ( allowedExtByMediaList && 'private' !== currentDirectoryObject.visibility ) {\n\t\t\tObject.keys( allowedExtByMediaList ).forEach( ( directoryType ) => {\n\t\t\t\tif ( 'album' === directoryType ) {\n\t\t\t\t\tdirOptions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'album',\n\t\t\t\t\t\t\ttext: __( 'Add new photo album', 'bp-attachments' ),\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else if ( 'audio_playlist' === directoryType ) {\n\t\t\t\t\tdirOptions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'audio_playlist',\n\t\t\t\t\t\t\ttext: __( 'Add new audio playlist', 'bp-attachments' ),\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else if ( 'video_playlist' === directoryType ) {\n\t\t\t\t\tdirOptions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'video_playlist',\n\t\t\t\t\t\t\ttext: __( 'Add new video playlist', 'bp-attachments' ),\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst dirList = dirOptions.map( ( dirOption ) => {\n\t\treturn (\n\t\t\t
  • \n\t\t\t\t showCreateDirForm( e, dirOption.id ) }>\n\t\t\t\t\t{ dirOption.text }\n\t\t\t\t\n\t\t\t
  • \n\t\t);\n\t} );\n\n\treturn (\n\t\t\n\t\t\t{ !! isAdminScreen && (\n\t\t\t\t

    \n\t\t\t\t\t{ pageTitle }\n\t\t\t\t

    \n\t\t\t) }\n\n\t\t\t{ ! isAdminScreen && (\n\t\t\t\t

    \n\t\t\t\t\t{ __( 'Library', 'bp-attachments' ) }\n\t\t\t\t

    \n\t\t\t) }\n\n\t\t\t{ !! canUpload && (\n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t showUploadForm( e ) }>\n\t\t\t\t\t\t\t{ __( 'Add new', 'bp-attachments' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t) }\n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default MediaLibraryHeader;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tDropZone,\n\t\tFormFileUpload,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport { bytesToSize } from '../utils/functions';\n\n/**\n * File Uploader element.\n */\nconst MediaLibraryUploader = ( { settings } ) => {\n\tconst { maxUploadFileSize, allowedExtTypes, allowedExtByMediaList } = settings;\n\tconst { updateFormState, createMedium } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst { formState, currentDirectoryObject } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY )\n\t\treturn {\n\t\t\tformState: store.getFormState(),\n\t\t\tcurrentDirectoryObject: store.getCurrentDirectoryObject(),\n\t\t}\n\t}, [] );\n\n\tconst resetFormState = () => {\n\t\tformState.action = '';\n\t\tupdateFormState( formState );\n\t}\n\n\tconst closeForm = ( e ) => {\n\t\te.preventDefault();\n\t\tresetFormState();\n\t};\n\n\tconst uploadMedia = ( files ) => {\n\t\tlet media;\n\t\tlet bytes = 0;\n\n\t\tif ( files.currentTarget && files.currentTarget.files ) {\n\t\t\tmedia = [ ...files.currentTarget.files ];\n\t\t} else {\n\t\t\tmedia = files;\n\t\t}\n\n\t\tlet numMedia = media.length;\n\n\t\tmedia.forEach( ( medium ) => {\n\t\t\tbytes += parseInt( medium.size, 10 );\n\t\t\tnumMedia -= 1;\n\n\t\t\tconst totalBytes = 0 === numMedia ? bytes : 0;\n\t\t\tcreateMedium( medium, totalBytes );\n\t\t} );\n\n\t\tresetFormState();\n\t};\n\n\tif ( ! formState.action || 'upload' !== formState.action ) {\n\t\treturn null;\n\t}\n\n\tlet allowedExts = allowedExtTypes;\n\tconst directoryTypes = [ 'album', 'audio_playlist', 'video_playlist' ];\n\n\tif ( currentDirectoryObject.type && -1 !== directoryTypes.indexOf( currentDirectoryObject.type ) ) {\n\t\tallowedExts = allowedExtByMediaList[ currentDirectoryObject.type ];\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t uploadMedia( files ) }\n\t\t\t\tclassName=\"uploader-inline\"\n\t\t\t/>\n\t\t\t\n\t\t\t
    \n\t\t\t\t

    { __( 'Drop files to upload', 'bp-attachments' ) }

    \n\t\t\t\t

    { __( 'or', 'bp-attachments' ) }

    \n\t\t\t\t uploadMedia( files ) }\n\t\t\t\t\tmultiple={ true }\n\t\t\t\t\taccept={ allowedExts }\n\t\t\t\t\tclassName=\"browser button button-hero\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Select Files', 'bp-attachments' ) }\n\t\t\t\t\n\t\t\t
    \n\t\t\t
    \n\t\t\t\t

    { sprintf( __( 'Maximum upload file size: %s.', 'bp-attachments' ), bytesToSize( maxUploadFileSize ) ) }

    \n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default MediaLibraryUploader;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tButton,\n\t\tTextControl,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Directory Creator element.\n */\nconst MediaLibraryDirectoryCreator = () => {\n\tconst [ directoryName, setDirectoryName ] = useState( '' );\n\tconst { updateFormState, createDirectory } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst formState = useSelect( ( select ) => {\n\t\treturn select( BP_ATTACHMENTS_STORE_KEY ).getFormState();\n\t}, [] );\n\n\tconst resetFormState = () => {\n\t\tformState.action = '';\n\t\tformState.directoryType = '';\n\t\treturn updateFormState( formState );\n\t}\n\n\tconst closeForm = ( e ) => {\n\t\te.preventDefault();\n\t\tresetFormState();\n\t};\n\n\tconst makeDirectory = ( e ) => {\n\t\te.preventDefault();\n\n\t\tconst directory = {\n\t\t\tdirectoryName: directoryName,\n\t\t\tdirectoryType: formState.directoryType,\n\t\t};\n\n\t\tcreateDirectory( directory );\n\t\tsetDirectoryName( '' );\n\t\tresetFormState();\n\t};\n\n\tif ( ! formState.action || 'createDirectory' !== formState.action ) {\n\t\treturn null;\n\t}\n\n\tlet title = __( 'Create a new directory', 'bp-attachments' );\n\tlet nameLabel = __( 'Type a name for your directory', 'bp-attachments' );\n\tlet buttonLabel = __( 'Save directory', 'bp-attachments' );\n\n\tif ( 'album' === formState.directoryType ) {\n\t\ttitle = __( 'Create a new photo album', 'bp-attachments' );\n\t\tnameLabel = __( 'Type a name for your photo album', 'bp-attachments' );\n\t\tbuttonLabel = __( 'Save photo album', 'bp-attachments' );\n\t} else if ( 'audio_playlist' === formState.directoryType ) {\n\t\ttitle = __( 'Create a new audio playlist', 'bp-attachments' );\n\t\tnameLabel = __( 'Type a name for your audio playlist', 'bp-attachments' );\n\t\tbuttonLabel = __( 'Save audio playlist', 'bp-attachments' );\n\t} else if ( 'video_playlist' === formState.directoryType ) {\n\t\ttitle = __( 'Create a new video playlist', 'bp-attachments' );\n\t\tnameLabel = __( 'Type a name for your video playlist', 'bp-attachments' );\n\t\tbuttonLabel = __( 'Save video playlist', 'bp-attachments' );\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t\n\t\t\t

    { title }

    \n\t\t\t setDirectoryName( directoryName ) }\n\t\t\t/>\n\t\t\t\n\t\t\n\t);\n}\n\nexport default MediaLibraryDirectoryCreator;\n","/**\n * WordPress dependencies\n */\n const {\n\tcomponents: {\n\t\tButton,\n\t\tExternalLink,\n\t\tTextareaControl,\n\t\tTextControl,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\nconst EditMediaItem = ( { medium, errorCallback } ) => {\n\tconst {\n\t\tid,\n\t\tname,\n\t\ttitle,\n\t\tdescription,\n\t\ticon,\n\t\tmedia_type,\n\t\tmime_type,\n\t\tvisibility,\n\t\tselected,\n\t\tlinks: {\n\t\t\tview,\n\t\t\tdownload,\n\t\t\tsrc\n\t\t},\n\t} = medium;\n\tconst [ editedMedium, editMedium ] = useState( {\n\t\ttitle: title,\n\t\tdescription: description,\n\t} );\n\tconst { updateMedium } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst isDisabled = title === editedMedium.title && description === editedMedium.description;\n\tconst hasNoPreview = -1 === [ 'image', 'video', 'audio' ].indexOf( media_type ) || 'private' === visibility;\n\tconst isDirectory = 'inode/directory' === mime_type;\n\tlet contentClasses = [ 'bp-attachment-edit-item__preview_content' ];\n\tif ( ! hasNoPreview ) {\n\t\tcontentClasses.push( 'has-rich-preview' );\n\t}\n\tif ( isDirectory ) {\n\t\tcontentClasses.push( 'is-directory' );\n\t}\n\n\tconst saveMediumProps = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tupdateMedium( {\n\t\t\tid: id,\n\t\t\tname: name,\n\t\t\ttitle: editedMedium.title,\n\t\t\tdescription: editedMedium.description,\n\t\t\tselected: selected,\n\t\t} ).then( ( response ) => {\n\t\t\tif ( response.error ) {\n\t\t\t\terrorCallback( false );\n\t\t\t} else if ( response.file ) {\n\t\t\t\teditMedium( {\n\t\t\t\t\t...editedMedium,\n\t\t\t\t\ttitle: response.file.title,\n\t\t\t\t\tdescription: response.file.description,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\tconst resetMediumProps = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\teditMedium( {\n\t\t\t...editedMedium,\n\t\t\ttitle: title,\n\t\t\tdescription: description,\n\t\t} );\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t
    \n\t\t\t\t

    { editedMedium.title }

    \n\t\t\t\t
      \n\t\t\t\t\t
    • { isDirectory ? __( 'Open directory page', 'bp-attachments' ) : __( 'Open media page', 'bp-attachments' ) }
    • \n\t\t\t\t\t{ ! isDirectory && (\n\t\t\t\t\t\t
    • { __( 'Download media', 'bp-attachments' ) }
    • \n\t\t\t\t\t) }\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t{ hasNoPreview && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 'image' === media_type && src && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 'audio' === media_type && src && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 'video' === media_type && src && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t

    { editedMedium.description }

    \n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t\t
    \n\t\t\t\t

    { sprintf( __( 'Edit %s', 'bp-attachments' ), name ) }

    \n\t\t\t\t

    { __( 'Use the below fields to edit media properties.', 'bp-attachments' ) }

    \n\t\t\t\t editMedium( { ...editedMedium, title: value } ) }\n\t\t\t\t\thelp={ __( 'Change the title of your medium to something more descriptive then its file name.', 'bp-attachments' ) }\n\t\t\t\t/>\n\t\t\t\t editMedium( { ...editedMedium, description: text } ) }\n\t\t\t\t\thelp={ __( 'Add or edit the description of your medium to tell your story about it.', 'bp-attachments' ) }\n\t\t\t\t/>\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default EditMediaItem;\n","/**\n * External dependencies.\n */\nconst {\n\tfind,\n\treverse,\n\tfilter,\n} = lodash;\n\n/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tButton,\n\t\tModal,\n\t\tTreeSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tuseState,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\thooks: {\n\t\tapplyFilters,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport { getDirectoryAncestors } from '../utils/functions';\nimport EditMediaItem from './edit-item';\n\n/**\n * Toolbar element.\n */\nconst MediaLibraryToolbar = ( { gridDisplay } ) => {\n\tconst {\n\t\tswitchDisplayMode,\n\t\trequestMedia,\n\t\ttoggleSelectable,\n\t\ttoggleMediaSelection,\n\t\tdeleteMedium,\n\t\tsetDisplayedUserId,\n\t} = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst {\n\t\tuser,\n\t\tdisplayedUserId,\n\t\tcurrentDirectory,\n\t\tcurrentDirectoryObject,\n\t\tflatTree,\n\t\ttree,\n\t\tisSelectable,\n\t\tselectedMedia,\n\t\tsettings,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY )\n\t\treturn {\n\t\t\tuser: store.getLoggedInUser(),\n\t\t\tdisplayedUserId: store.getDisplayedUserId(),\n\t\t\tcurrentDirectory: store.getCurrentDirectory(),\n\t\t\tcurrentDirectoryObject: store.getCurrentDirectoryObject(),\n\t\t\tflatTree: store.getFlatTree(),\n\t\t\ttree: store.getTree(),\n\t\t\tisSelectable: store.isSelectable(),\n\t\t\tselectedMedia: store.selectedMedia(),\n\t\t\tsettings: store.getSettings(),\n\t\t}\n\t}, [] );\n\tconst [ page, setPage ] = useState( currentDirectory );\n\tconst [ isOpen, toggleModal ] = useState( false );\n\tconst canSelect = true !== currentDirectoryObject.readonly;\n\tconst hasSelectedMedia = isSelectable && selectedMedia.length !== 0;\n\tconst hasOneSelectedMedia = isSelectable && selectedMedia.length === 1;\n\tconst canModerate = !! settings.isAdminScreen && !! user.capabilities && -1 !== user.capabilities.indexOf( 'bp_moderate' );\n\n\tif ( currentDirectory !== page ) {\n\t\tsetPage( currentDirectory );\n\t}\n\n\tconst switchMode = ( e, isGrid ) => {\n\t\te.preventDefault();\n\t\tswitchDisplayMode( isGrid );\n\t};\n\n\tconst changeDirectory = ( directory ) => {\n\t\tsetPage( directory );\n\t\tconst updateDisplayedUserId = 0 === directory.indexOf( 'member-' ) ? parseInt( directory.replace( 'member-', '' ), 10 ) : 0;\n\t\tif ( !! updateDisplayedUserId ) {\n\t\t\tsetDisplayedUserId( updateDisplayedUserId );\n\t\t}\n\n\t\tconst directoryItem = find( flatTree, { id: directory } );\n\t\tlet args = {};\n\n\t\tif ( directoryItem ) {\n\t\t\targs.directory = directoryItem.slug;\n\t\t\targs.parent = directoryItem.id;\n\n\t\t\tif ( directoryItem.parent && directoryItem.object ) {\n\t\t\t\tlet chunks = reverse( getDirectoryAncestors(\n\t\t\t\t\tflatTree,\n\t\t\t\t\tdirectoryItem.parent\n\t\t\t\t).map( ( parent ) => parent.slug ) );\n\n\t\t\t\tif ( 'members' === directoryItem.object ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * In a future release, when Groups will be supported. The root directories will be:\n\t\t\t\t\t * - My Groups Media,\n\t\t\t\t\t * - My Media.\n\t\t\t\t\t *\n\t\t\t\t\t * The \"My Media\" ID is 'member'. We need to remove this from chunks as files are stored in\n\t\t\t\t\t * `/uploads/buddypress/public/members/{userID}` or `../buddypress-private/members/{userID}`.\n\t\t\t\t\t */\n\t\t\t\t\tconst memberIndex = chunks.indexOf( 'member' );\n\t\t\t\t\tif ( -1 !== memberIndex ) {\n\t\t\t\t\t\tchunks.splice( memberIndex, 1 );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( chunks.length ) {\n\t\t\t\t\t\tchunks.splice( 1, 0, directoryItem.object, user.id );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Use this filter to customize the pathArray for other components (eg: groups).\n\t\t\t\t\tchunks = applyFilters(\n\t\t\t\t\t\t'buddypress.Attachments.toolbarTreeSelect.pathArray',\n\t\t\t\t\t\tchunks,\n\t\t\t\t\t\tdirectoryItem,\n\t\t\t\t\t\tuser.id\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\targs.path = '/' + chunks.join( '/' );\n\t\t\t}\n\n\t\t\tif ( directoryItem.object ) {\n\t\t\t\targs.object = directoryItem.object;\n\t\t\t}\n\n\t\t\tif ( !! updateDisplayedUserId || !! displayedUserId ) {\n\t\t\t\targs.user_id = updateDisplayedUserId !== displayedUserId ? updateDisplayedUserId : displayedUserId;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * When changing the selected option to 'All members', reset the displayedUserId.\n\t\t\t * so that the Admin can go back to the list of members.\n\t\t\t */\n\t\t} else if ( !! displayedUserId ) {\n\t\t\tsetDisplayedUserId( 0 );\n\t\t}\n\n\t\treturn requestMedia( args );\n\t};\n\n\tconst onToggleSectable = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst toggle = ! isSelectable;\n\n\t\tif ( ! toggle ) {\n\t\t\ttoggleMediaSelection( ['all'], toggle );\n\t\t}\n\n\t\treturn toggleSelectable( toggle );\n\t};\n\n\tconst onDeleteSelected = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tlet bytes = 0;\n\t\tlet numSelectedMedia = selectedMedia.length;\n\n\t\tselectedMedia.forEach( medium => {\n\t\t\t// Deleted folders do not have a size.\n\t\t\tif ( !! medium.size ) {\n\t\t\t\tbytes += parseInt( medium.size, 10 );\n\t\t\t}\n\n\t\t\tnumSelectedMedia -= 1;\n\n\t\t\tconst totalBytes = 0 === numSelectedMedia ? bytes : 0;\n\t\t\tdeleteMedium( medium, totalBytes );\n\t\t} );\n\n\t\treturn toggleSelectable( false );\n\t};\n\n\tconst onEditSelected = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\ttoggleModal( true );\n\t};\n\n\treturn (\n\t\t
    \n\t\t\t
    \n\t\t\t\t{ ! isSelectable && (\n\t\t\t\t\t
    \n\t\t\t\t\t\t switchMode( e, false ) } className={ gridDisplay ? 'view-list' : 'view-list current' }>\n\t\t\t\t\t\t\t{ __( 'Display list', 'bp-attachments' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\t switchMode( e, true ) } className={ gridDisplay ? 'view-grid current' : 'view-grid' }>\n\t\t\t\t\t\t\t{ __( 'Display grid', 'bp-attachments' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t) }\n\t\t\t\t{ canSelect && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ canSelect && hasOneSelectedMedia && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ canSelect && hasSelectedMedia && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ isOpen && (\n\t\t\t\t\t\t toggleModal( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t) }\n\t\t\t
    \n\t\t\t{ !! tree.length && (\n\t\t\t\t
    \n\t\t\t\t\t changeDirectory( directory ) }\n\t\t\t\t\t\tselectedId={ page }\n\t\t\t\t\t\ttree={ ! canModerate ? tree : filter( tree, { id: 'member-' + displayedUserId } ) }\n\t\t\t\t\t/>\n\t\t\t\t
    \n\t\t\t) }\n\t\t
    \n\t);\n};\n\nexport default MediaLibraryToolbar;\n","/**\n * External dependencies\n */\nconst { template } = lodash;\n\nfunction setTemplate( tmpl ) {\n\tconst options = {\n\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\tinterpolate: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g,\n\t\tescape: /\\{\\{([^\\}]+?)\\}\\}(?!\\})/g,\n\t\tvariable: 'data'\n\t};\n\n\treturn template( document.querySelector( '#tmpl-' + tmpl ).innerHTML, options );\n}\n\nexport default setTemplate;\n","/**\n * WordPress dependencies\n */\n const {\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\tcomponents: {\n\t\tModal,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport setTemplate from '../utils/set-template';\nimport EditMediaItem from './edit-item';\n\nconst MediaItem = ( props ) => {\n\tconst {\n\t\tmedium,\n\t\tselected,\n\t\tisGrid,\n\t} = props;\n\tconst Template = !! isGrid ? setTemplate( 'bp-attachments-media-item' ) : setTemplate( 'bp-attachments-list-media-item' );\n\tconst { toggleMediaSelection, requestMedia, setDisplayedUserId } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst [ isOpen, toggleModal ] = useState( false );\n\tconst [ isSelected, selectMedia ] = useState( selected );\n\tconst { getRelativePath, isSelectable } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tgetRelativePath: store.getRelativePath(),\n\t\t\tisSelectable: store.isSelectable(),\n\t\t};\n\t}, [] );\n\n\tif ( ! isSelectable && ! selected && isSelected ) {\n\t\tselectMedia( false );\n\t}\n\n\tconst classes = isSelected ? 'media-item selected' : 'media-item';\n\tconst onMediaClick = () => {\n\t\tconst { mimeType, name, isSelectable, id, object } = props;\n\n\t\tif ( isSelectable ) {\n\t\t\tselectMedia( ! isSelected );\n\t\t\treturn toggleMediaSelection( [ id ], ! isSelected );\n\t\t}\n\n\t\tif ( 'inode/directory' === mimeType ) {\n\t\t\tconst displayedUserId = 0 === id.indexOf( 'member-' ) ? parseInt( id.replace( 'member-', '' ), 10 ) : 0;\n\n\t\t\tif ( !! displayedUserId ) {\n\t\t\t\tsetDisplayedUserId( displayedUserId );\n\t\t\t}\n\n\t\t\treturn requestMedia( { directory: name, path: getRelativePath, object: object, parent: id } );\n\t\t}\n\n\t\ttoggleModal( true );\n\t};\n\n\treturn (\n\t\t\n\t\t\t onMediaClick() }\n\t\t\t/>\n\t\t\t{ isOpen && (\n\t\t\t\t toggleModal( false ) }\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) }\n\t\t\n\t);\n};\n\nexport default MediaItem;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tAnimate,\n\t\tDashicon,\n\t\tNotice,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Notices element.\n */\nconst MediaLibraryNotices = () => {\n\tconst { uploads, errors } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tuploads: store.getUploads(),\n\t\t\terrors: store.getErrors(),\n\t\t};\n\t}, [] );\n\tconst { removeMediumError } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst onRemoveError = ( errorID ) => {\n\t\treturn removeMediumError( errorID );\n\t};\n\n\tlet errorNotices = [];\n\n\tif ( errors && errors.length ) {\n\t\terrorNotices = errors.map( ( error ) => {\n\t\t\treturn (\n\t\t\t\t onRemoveError( error.id ) }\n\t\t\t\t\tisDismissible={ true }\n\t\t\t\t>\n\t\t\t\t\t

    \n\t\t\t\t\t\t\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: file name. 2: error message. */\n\t\t\t\t\t\t\t__( '« %1$s » wasn‘t added to the media library. %2$s', 'bp-attachments' ),\n\t\t\t\t\t\t\terror.name,\n\t\t\t\t\t\t\terror.error\n\t\t\t\t\t\t) }\n\t\t\t\t\t

    \n\t\t\t\t\n\t\t\t);\n\t\t} );\n\t}\n\n\tlet loadingNotice = null;\n\tconst numberUploads = uploads && uploads.length ? uploads.length : 0;\n\n\tif ( !! numberUploads ) {\n\t\t// Looks like WP CLI can't find _n() usage.\n\t\tlet uploadingMedia = __( 'Uploading the media, please wait.', 'bp-attachments' );\n\t\tif ( numberUploads > 1 ) {\n\t\t\t/* translators: %d: number of media being uploaded. */\n\t\t\tuploadingMedia = sprintf( __( 'Uploading %d media, please wait.', 'bp-attachments' ), numberUploads );\n\t\t}\n\n\t\tloadingNotice = (\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t{ ( { className } ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ uploadingMedia }\n\t\t\t\t\t\t\t

    \n\t\t\t\t\t\t\n\t\t\t\t\t) }\n\t\t\t\t\n\t\t\t
    \n\t\t);\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t{ loadingNotice }\n\t\t\t{ errorNotices }\n\t\t
    \n\t);\n}\n\nexport default MediaLibraryNotices;\n","/**\n * WordPress dependencies\n */\nconst {\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport MediaItem from './item';\nimport MediaLibraryNotices from './notices';\nimport { bytesToSize } from '../utils/functions';\n\n/**\n * Main element.\n */\nconst MediaLibraryMain = ( { gridDisplay } ) => {\n\tconst { items, isSelectable } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\titems: store.getMedia(),\n\t\t\tisSelectable: store.isSelectable(),\n\t\t};\n\t}, [] );\n\tconst modeClass = true === gridDisplay ? ' grid' : ' list';\n\n\tlet mediaItems = null;\n\tif ( items.length ) {\n\t\tmediaItems = items.map( ( item ) => {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t} );\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t\n\t\t\t
    \n\t\t\t\t{ mediaItems }\n\t\t\t\t{ ! items.length && (\n\t\t\t\t\t

    { __( 'No community media items found.', 'bp-attachments' ) }

    \n\t\t\t\t) }\n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default MediaLibraryMain;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tButton,\n\t\tSpinner,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Footer element.\n */\nconst MediaLibraryFooter = ( { settings } ) => {\n\tconst { requestMedia } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst {\n\t\tuser: {\n\t\t\tcapabilities,\n\t\t},\n\t\tpagination,\n\t\tmediaCount,\n\t\tisQuerying,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tuser: store.getLoggedInUser(),\n\t\t\tpagination: store.getPagination(),\n\t\t\tmediaCount: store.countMedia(),\n\t\t\tisQuerying: store.isQuerying(),\n\t\t};\n\t}, [] );\n\tconst canPaginate = !! settings.isAdminScreen && !! capabilities && -1 !== capabilities.indexOf( 'bp_moderate' );\n\tconst totalUserLibraries = parseInt( pagination.membersDisplayedAmount, 10 );\n\n\tconst onLoadMore = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst { membersPage } = pagination;\n\n\t\treturn requestMedia( { page: membersPage + 1 } );\n\t}\n\n\tif ( ! canPaginate || ! pagination.membersDisplayedAmount ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t{\n\t\t\t\ttrue === isQuerying && (\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}\n\t\t\t

    \n\t\t\t\t{\n\t\t\t\t\t1 !== totalUserLibraries ? sprintf(\n\t\t\t\t\t\t__( 'Showing %1$s of %2$s media libraries', 'bp-attachments' ),\n\t\t\t\t\t\tmediaCount,\n\t\t\t\t\t\ttotalUserLibraries\n\t\t\t\t\t) : __( 'Showing one media library', 'bp-attachments' )\n\t\t\t\t}\n\t\t\t

    \n\t\t\t{\n\t\t\t\tmediaCount !== totalUserLibraries && ! isQuerying && (\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}\n\t\t
    \n\t);\n};\n\nexport default MediaLibraryFooter;\n","/**\n * WordPress dependencies\n */\nconst {\n\tdomReady,\n\telement: {\n\t\tcreateElement,\n\t\trender,\n\t\tFragment,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from './store';\nimport MediaLibraryHeader from './elements/header';\nimport MediaLibraryUploader from './elements/uploader';\nimport MediaLibraryDirectoryCreator from './elements/directory-creator';\nimport MediaLibraryToolbar from './elements/toolbar';\nimport MediaLibraryMain from './elements/main';\nimport MediaLibraryFooter from './elements/footer';\n\nconst MediaLibrary = ( { settings } ) => {\n\tconst { isGrid, globalSettings } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\t\treturn {\n\t\t\tisGrid: store.isGridDisplayMode(),\n\t\t\tglobalSettings: store.getSettings(),\n\t\t};\n\t}, [] );\n\n\tif ( ! Object.keys( globalSettings ).length ) {\n\t\tconst { setSettings } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\t\tsetSettings( settings );\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\ndomReady( function() {\n\tconst settings = window.bpAttachmentsMediaLibrarySettings || {};\n\trender( , document.querySelector( '#bp-media-library' ) );\n} );\n"],"names":["STORE_KEY","i18n","__","wp","filter","lodash","getDirectoryAncestors","tree","parentId","parents","id","forEach","parent","grandParents","bytesToSize","bytes","sizes","i","parseInt","Math","floor","log","toFixed","trim","groupBy","indexOf","find","defaultTo","getSettings","state","settings","getRequestsContext","isAdminScreen","isGridDisplayMode","isGrid","getLoggedInUser","user","getDisplayedUserId","displayedUserId","getFormState","formState","isUploading","uploading","isQuerying","querying","uploadEnded","ended","getUploads","uploads","getErrors","errors","getMedia","files","countMedia","length","getCurrentDirectory","currentDirectory","getCurrentDirectoryObject","defaultValue","readonly","getTree","groupedTree","currentChildrenIds","map","child","childId","currentAncestors","ancestor","Object","keys","treeIndex","fillWithChildren","items","item","children","getFlatTree","isSelectable","selectedMedia","getRelativePath","relativePath","getDestinationData","object","destinationData","split","visibility","getPagination","pagination","TYPES","SET_SETTINGS","GET_LOGGED_IN_USER","SET_DISPLAYED_USER_ID","GET_MEDIA","ADD_MEDIUM","FILL_TREE","PURGE_TREE","REMOVE_MEDIUM","FETCH_FROM_API","GET_FROM_API","CREATE_FROM_API","UPDATE_FROM_API","DELETE_FROM_API","UPLOAD_START","UPLOAD_END","RESET_UPLOADS","ADD_ERROR","REMOVE_ERROR","TOGGLE_SELECTABLE","TOGGLE_MEDIA_SELECTION","SWITCH_DISPLAY_MODE","UPDATE_FORM_STATE","SET_QUERY_STATUS","uniqueId","hasIn","trimEnd","data","dispatch","select","url","addQueryArgs","setSettings","type","types","fetchFromAPI","path","parse","getFromAPI","response","createFromAPI","updateFromAPI","deleteFromAPI","totalBytes","switchDisplayMode","setDisplayedUserId","userId","updateFormState","params","setItemTree","directory","slug","name","title","media_type","initTree","directories","mime_type","itemTree","addItemTree","removeItemTree","itemId","toggleSelectable","toggleMediaSelection","ids","isSelected","addMedium","file","addMediumError","error","createMedium","upload","store","formData","FormData","append","uploadRelativePath","replace","message","uploaded","createDirectory","directoryName","directoryType","createDirRelativePath","currentDir","updateMedium","medium","update","relative_path","description","selected","updated","parseResponseMedia","async","arguments","undefined","json","then","membersPage","requestMedia","args","relativePathHeader","context","user_id","headers","get","membersDisplayedAmount","totalMembersPage","page","removeMedium","deleteMedium","deleted","previous","removeMediumError","errorID","getLoggedInUserAction","window","bpAttachmentsMediaLibrarySettings","_requestContext","getMediaAction","reject","DEFAULT_STATE","$101f7048d1a3a5c4$export$2e2bcd8739ae039","action","media","u","apiFetch","controls","_ref","_ref2","_ref3","method","body","_ref4","_ref5","total_bytes","registerStore","reducer","actions","selectors","resolvers","BP_ATTACHMENTS_STORE_KEY","components","Popover","useDispatch","useSelect","element","createElement","Fragment","useState","$fcd8ebc78e2f45bd$export$2e2bcd8739ae039","currentDirectoryObject","isOpen","setOpen","toggleClass","dashiconClass","canUpload","allowedExtByMediaList","hrClass","pageTitle","capabilities","showUploadForm","e","preventDefault","parentDirectory","dirOptions","text","push","dirList","dirOption","$fcd8ebc78e2f45bd$var$createElement","key","href","className","onClick","showCreateDirForm","$fcd8ebc78e2f45bd$var$Fragment","$fcd8ebc78e2f45bd$var$Popover","noArrow","onFocusOutside","DropZone","FormFileUpload","sprintf","$9677e9ae62a97894$export$2e2bcd8739ae039","maxUploadFileSize","allowedExtTypes","resetFormState","uploadMedia","currentTarget","numMedia","size","allowedExts","$9677e9ae62a97894$var$createElement","$9677e9ae62a97894$var$DropZone","label","onFilesDrop","closeForm","$9677e9ae62a97894$var$FormFileUpload","onChange","multiple","accept","Button","TextControl","$bdff20d4da09a7d7$export$2e2bcd8739ae039","setDirectoryName","nameLabel","buttonLabel","$bdff20d4da09a7d7$var$createElement","$bdff20d4da09a7d7$var$TextControl","value","$bdff20d4da09a7d7$var$Button","variant","makeDirectory","ExternalLink","TextareaControl","$8bf00b4ce561239f$export$2e2bcd8739ae039","errorCallback","icon","links","view","download","src","editedMedium","editMedium","isDisabled","hasNoPreview","isDirectory","contentClasses","$8bf00b4ce561239f$var$createElement","$8bf00b4ce561239f$var$ExternalLink","join","preload","muted","$8bf00b4ce561239f$var$TextControl","help","$8bf00b4ce561239f$var$TextareaControl","$8bf00b4ce561239f$var$Button","disabled","reverse","Modal","TreeSelect","hooks","applyFilters","$b3153ca487c736b9$export$2e2bcd8739ae039","gridDisplay","flatTree","setPage","toggleModal","canSelect","hasSelectedMedia","hasOneSelectedMedia","canModerate","switchMode","$b3153ca487c736b9$var$createElement","$b3153ca487c736b9$var$Button","event","toggle","onToggleSectable","numSelectedMedia","onDeleteSelected","$b3153ca487c736b9$var$Modal","onRequestClose","$b3153ca487c736b9$var$TreeSelect","noOptionLabel","updateDisplayedUserId","directoryItem","chunks","memberIndex","splice","changeDirectory","selectedId","template","$d68106db0b2679ed$export$2e2bcd8739ae039","tmpl","document","querySelector","innerHTML","evaluate","interpolate","escape","variable","$25915412e7fc4248$export$2e2bcd8739ae039","props","Template","setTemplate","selectMedia","$25915412e7fc4248$var$createElement","$25915412e7fc4248$var$Fragment","dangerouslySetInnerHTML","__html","role","mimeType","onMediaClick","$25915412e7fc4248$var$Modal","Animate","Dashicon","Notice","$bae870346126130f$export$2e2bcd8739ae039","errorNotices","$bae870346126130f$var$createElement","$bae870346126130f$var$Notice","status","onRemove","onRemoveError","isDismissible","$bae870346126130f$var$Dashicon","loadingNotice","numberUploads","uploadingMedia","$bae870346126130f$var$Animate","$1e56901890e67653$export$2e2bcd8739ae039","modeClass","mediaItems","$1e56901890e67653$var$createElement","mediaType","vignette","orientation","Spinner","$f1e2296ec28b8041$export$2e2bcd8739ae039","mediaCount","canPaginate","totalUserLibraries","$f1e2296ec28b8041$var$createElement","$f1e2296ec28b8041$var$Spinner","$f1e2296ec28b8041$var$Button","onLoadMore","domReady","render","MediaLibrary","globalSettings","$85929bbc1a3f4ac8$var$createElement","$85929bbc1a3f4ac8$var$Fragment","$85929bbc1a3f4ac8$var$MediaLibrary"],"version":3,"file":"index.js.map"} \ No newline at end of file +{"mappings":"uGAKQ,MAAMA,EAAY,iB,w9BCF1B,MACCC,MAAMC,GACLA,IAEEC,IAKEC,OAAEA,GAAWC,OAENC,EAAwB,CAAEC,EAAMC,KAC5C,IAAIC,EAAUL,EAAQG,EAAM,CAAEG,GAAIF,IAOlC,OALAC,EAAQE,SAAWC,IAClB,MAAMC,EAAeP,EAAuBC,EAAMK,EAAOA,QACzDH,EAAU,IAAKA,KAAYI,EAA3B,IAGMJ,CAAP,EAGYK,EAAgBC,IAC5B,MAAMC,EAAQ,CACbd,EAAI,QAAS,kBACbA,EAAI,KAAM,kBACVA,EAAI,KAAM,kBACVA,EAAI,KAAM,kBACVA,EAAI,KAAM,mBAGX,GAAe,IAAVa,EACJ,MAAO,KAAOC,EAAM,GAGrB,MAAMC,EAAIC,SAAUC,KAAKC,MAAOD,KAAKE,IAAKN,GAAUI,KAAKE,IAAK,OAAU,IAExE,OAAW,IAANJ,EACI,GAAEF,KAASC,EAAMC,KAGlB,IAAKF,EAAU,MAAQE,GAAMK,QAAS,MAASN,EAAOC,IAA9D,ECzCD,MAAMM,KACLA,EADKC,QAELA,EAFKpB,OAGL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SAASC,cAAe,qB","sources":["src/media-library/store/constants.js","src/media-library/utils/functions.js","src/media-library/store/selectors.js","src/media-library/store/action-types.js","src/media-library/store/actions.js","src/media-library/store/resolvers.js","src/media-library/store/reducers.js","src/media-library/store/controls.js","src/media-library/store/index.js","src/media-library/elements/header.js","src/media-library/elements/uploader.js","src/media-library/elements/directory-creator.js","src/media-library/elements/edit-item.js","src/media-library/elements/toolbar.js","src/media-library/utils/set-template.js","src/media-library/elements/item.js","src/media-library/elements/notices.js","src/media-library/elements/main.js","src/media-library/elements/footer.js","src/media-library/index.js"],"sourcesContent":["/**\n * Identifier key for this store reducer.\n *\n * @type {string}\n */\n export const STORE_KEY = 'bp/attachments';\n","/**\n * WordPress dependencies\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * External dependencies\n */\nconst { filter } = lodash;\n\nexport const getDirectoryAncestors = ( tree, parentId ) => {\n\tlet parents = filter( tree, { id: parentId } );\n\n\tparents.forEach( ( parent ) => {\n\t\tconst grandParents = getDirectoryAncestors( tree, parent.parent );\n\t\tparents = [ ...parents, ...grandParents ];\n\t} );\n\n\treturn parents;\n}\n\nexport const bytesToSize = ( bytes ) => {\n\tconst sizes = [\n\t\t__( 'Bytes', 'bp-attachments' ),\n\t\t__( 'KB', 'bp-attachments' ),\n\t\t__( 'MB', 'bp-attachments' ),\n\t\t__( 'GB', 'bp-attachments' ),\n\t\t__( 'TB', 'bp-attachments' ),\n\t];\n\n\tif ( bytes === 0 ) {\n\t\treturn '0 ' + sizes[0];\n\t}\n\n\tconst i = parseInt( Math.floor( Math.log( bytes ) / Math.log( 1024 ) ), 10 );\n\n\tif ( i === 0 ) {\n\t\treturn `${bytes} ${sizes[i]}`;\n\t}\n\n\treturn `${ ( bytes / ( 1024 ** i ) ).toFixed( 1 ) } ${ sizes[ i ] }`;\n}\n\nexport default bytesToSize;\n","/**\n * External dependencies.\n */\nconst {\n\ttrim,\n\tgroupBy,\n\tfilter,\n\tindexOf,\n\tfind,\n\tdefaultTo,\n} = lodash;\n\n/**\n * Internal dependencies.\n */\nimport { getDirectoryAncestors } from '../utils/functions';\n\n/**\n * Returns the Community Media Library settings.\n *\n * @param {Object} state\n * @returns {Object} The Community Media Library settings.\n */\nexport const getSettings = ( state ) => {\n\tconst { settings } = state;\n\treturn settings;\n}\n\n/**\n * Returns the requests context.\n *\n * @param {Object} state\n * @returns {string} The requests context (`edit` or `view`).\n */\nexport const getRequestsContext = ( state ) => {\n\tconst {\n\t\tsettings: {\n\t\t\tisAdminScreen,\n\t\t}\n\t} = state;\n\n\treturn true === isAdminScreen ? 'edit' : 'view';\n}\n\n/**\n * Returns whether the display mode is Grid or not.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if the display mode is Grid. False otherwise.\n */\nexport const isGridDisplayMode = ( state ) => {\n\tconst { isGrid } = state;\n\treturn isGrid;\n}\n\n/**\n * Returns the logged in user Object.\n *\n * @param {Object} state The current state.\n * @return {Object} The logged in user Object.\n */\nexport const getLoggedInUser = ( state ) => {\n\tconst { user } = state;\n\treturn user;\n};\n\n/**\n * Returns the displayed user ID.\n *\n * @param {Object} state The current state.\n * @return {integer} The displayed user ID.\n */\nexport const getDisplayedUserId = ( state ) => {\n\tconst { displayedUserId } = state;\n\treturn displayedUserId;\n};\n\n/**\n * Returns whether the display mode is Grid or not.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if the display mode is Grid. False otherwise.\n */\nexport const getFormState = ( state ) => {\n\tconst { formState } = state;\n\treturn formState || {};\n}\n\n/**\n * Returns whether an upload is being processed.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if an upload is being processed. False otherwise.\n */\nexport const isUploading = ( state ) => {\n\tconst { uploading } = state;\n\treturn uploading;\n};\n\n/**\n * Returns whether a query is being processed.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if a query is being processed. False otherwise.\n */\n export const isQuerying = ( state ) => {\n\tconst { querying } = state;\n\treturn querying;\n};\n\n/**\n * Returns whether an upload has been processed.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if an uploads has been processed. False otherwise.\n */\n export const uploadEnded = ( state ) => {\n\tconst { ended } = state;\n\treturn ended;\n};\n\n/**\n * Returns the list of uploaded file Objects.\n *\n * @param {Object} state The current state.\n * @return {array} The list of uploaded file Objects.\n */\nexport const getUploads = ( state ) => {\n\tconst { uploads } = state;\n\treturn uploads;\n};\n\n/**\n * Returns the list of errors.\n *\n * @param {Object} state The current state.\n * @return {array} The list of errors.\n */\nexport const getErrors = ( state ) => {\n\tconst { errors } = state;\n\treturn errors;\n};\n\n/**\n * Returns the community media objects list.\n *\n * @param {Object} state The current state.\n * @return {array} The list of community media objects.\n */\nexport const getMedia = ( state ) => {\n\tconst { files } = state;\n\treturn files;\n};\n\n/**\n * Returns the number of community media objects.\n *\n * @param {Object} state The current state.\n * @return {integer} The list of community media objects.\n */\nexport const countMedia = ( state ) => {\n\tconst { files } = state;\n\treturn files.length;\n};\n\n/**\n * Returns the current directory.\n *\n * @param {Object} state The current state.\n * @return {string} The current directory.\n */\nexport const getCurrentDirectory = ( state ) => {\n\tconst { currentDirectory } = state;\n\treturn currentDirectory || '';\n};\n\n/**\n * Returns the current directory object.\n *\n * @param {Object} state The current state.\n * @return {Object} The current directory object.\n */\n export const getCurrentDirectoryObject = ( state ) => {\n\tconst { currentDirectory, tree } = state;\n\tconst defaultValue = { readonly: true };\n\n\tif ( '' !== currentDirectory ) {\n\t\treturn defaultTo(\n\t\t\tfind( tree, { id: currentDirectory } ),\n\t\t\tdefaultValue\n\t\t);\n\t}\n\n\treturn defaultValue;\n};\n\n/**\n * Returns the directories Tree.\n *\n * @param {Object} state The current state.\n * @return {array} The directories Tree.\n */\n export const getTree = ( state ) => {\n\tconst { tree, currentDirectory } = state;\n\tconst groupedTree = groupBy( tree, 'parent' );\n\tconst currentChildrenIds = filter( tree, { 'parent': currentDirectory || 0 } ).map( ( child ) => child.id );\n\n\t// Makes sure to only list current directory children.\n\tif ( currentChildrenIds && currentChildrenIds.length ) {\n\t\tcurrentChildrenIds.forEach( ( childId ) => {\n\t\t\tif ( groupedTree[ childId ] ) {\n\t\t\t\tdelete groupedTree[ childId ];\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Makes sure to avoid listing children of directories that are not an ancestor of the currentDirectory one.\n\tif ( currentDirectory ) {\n\t\tconst currentAncestors = getDirectoryAncestors(\n\t\t\ttree,\n\t\t\tcurrentDirectory\n\t\t).map( ( ancestor ) => ancestor.id );\n\n\t\tObject.keys( groupedTree ).forEach( ( treeIndex ) => {\n\t\t\tif ( 0 !== parseInt( treeIndex, 10 ) && -1 === indexOf( currentAncestors, treeIndex ) ) {\n\t\t\t\tdelete groupedTree[ treeIndex ];\n\t\t\t}\n\t\t} );\n\t}\n\n\tconst fillWithChildren = ( items ) => {\n\t\treturn items.map( ( item ) => {\n\t\t\tconst children = groupedTree[ item.id ];\n\t\t\treturn {\n\t\t\t\t...item,\n\t\t\t\tchildren: children && children.length ?\n\t\t\t\t\tfillWithChildren( children ) :\n\t\t\t\t\t[],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( groupedTree[0] || [] );\n};\n\n/**\n * Returns the directory flat list.\n *\n * @param {Object} state The current state.\n * @return {array} The directory flat list.\n */\n export const getFlatTree = ( state ) => {\n\tconst { tree } = state;\n\treturn tree || [];\n};\n\n/**\n * Returns whether a media/directory item is selectable.\n *\n * @param {Object} state The current state.\n * @return {boolean} True if a media/directory item is selectable. False otherwise.\n */\nexport const isSelectable = ( state ) => {\n\tconst { isSelectable } = state;\n\treturn isSelectable;\n};\n\n/**\n * Returns the selected media.\n *\n * @param {Object} state The current state.\n * @return {array} The list of selected media.\n */\nexport const selectedMedia = ( state ) => {\n\tconst { files } = state;\n\n\treturn filter( files, [ 'selected', true ] );\n}\n\n/**\n * Returns the current relative path.\n *\n * @param {Object} state The current state.\n * @return {string} The current relative path.\n */\nexport const getRelativePath = ( state ) => {\n\tconst { relativePath } = state;\n\treturn relativePath;\n};\n\n/**\n * Returns the destination data for media.\n *\n * @param {Object} state The current state.\n * @return {Object} The destination data for media.\n */\nexport const getDestinationData = ( state ) => {\n\tconst { relativePath } = state;\n\n\tif ( ! relativePath ) {\n\t\treturn {\n\t\t\tobject: 'members',\n\t\t}\n\t}\n\n\tconst destinationData = trim( relativePath, '/' ).split( '/' );\n\n\treturn {\n\t\tvisibility: destinationData[0] ? destinationData[0] : 'public',\n\t\tobject: destinationData[1] ? destinationData[1] : 'members',\n\t\titem: destinationData[2] ? destinationData[2] : '',\n\t}\n};\n\n/**\n * Returns the Member Media Libraries pagination data.\n *\n * @param {Object} state The current state.\n * @return {Object} The Member Media Libraries pagination data.\n */\nexport const getPagination = ( state ) => {\n\tconst { pagination } = state;\n\treturn pagination;\n};\n","export const TYPES = {\n\tSET_SETTINGS: 'SET_SETTINGS',\n\tGET_LOGGED_IN_USER: 'GET_LOGGED_IN_USER',\n\tSET_DISPLAYED_USER_ID: 'SET_DISPLAYED_USER_ID',\n\tGET_MEDIA: 'GET_MEDIA',\n\tADD_MEDIUM: 'ADD_MEDIUM',\n\tFILL_TREE: 'FILL_TREE',\n\tPURGE_TREE: 'PURGE_TREE',\n\tREMOVE_MEDIUM: 'REMOVE_MEDIUM',\n\tFETCH_FROM_API: 'FETCH_FROM_API',\n\tGET_FROM_API: 'GET_FROM_API',\n\tCREATE_FROM_API: 'CREATE_FROM_API',\n\tUPDATE_FROM_API: 'UPDATE_FROM_API',\n\tDELETE_FROM_API: 'DELETE_FROM_API',\n\tUPLOAD_START: 'UPLOAD_START',\n\tUPLOAD_END: 'UPLOAD_END',\n\tRESET_UPLOADS: 'RESET_UPLOADS',\n\tADD_ERROR: 'ADD_ERROR',\n\tREMOVE_ERROR: 'REMOVE_ERROR',\n\tTOGGLE_SELECTABLE: 'TOGGLE_SELECTABLE',\n\tTOGGLE_MEDIA_SELECTION: 'TOGGLE_MEDIA_SELECTION',\n\tSWITCH_DISPLAY_MODE: 'SWITCH_DISPLAY_MODE',\n\tUPDATE_FORM_STATE: 'UPDATE_FORM_STATE',\n\tSET_QUERY_STATUS: 'SET_QUERY_STATUS',\n};\n","/**\n * External dependencies.\n */\n const {\n\tuniqueId,\n\thasIn,\n\ttrim,\n\ttrimEnd,\n\tfilter,\n} = lodash;\n\n/**\n * WordPress dependencies.\n */\nconst {\n\tdata: {\n\t\tdispatch,\n\t\tselect,\n\t},\n\turl: {\n\t\taddQueryArgs,\n\t}\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { TYPES as types } from './action-types';\nimport { STORE_KEY } from './constants';\n\n/**\n * Returns an action to set the BP attachments Media Library settings.\n *\n * @param {Object} settings The settings to use.\n * @return {Object} Object for action.\n */\nexport function setSettings( settings ) {\n\treturn {\n\t\ttype: types.SET_SETTINGS,\n\t\tsettings,\n\t};\n};\n\n/**\n * Returns an action object used to fetch media from the API.\n *\n * @param {string} path Endpoint path.\n * @param {boolean} parse Should we parse the request.\n * @return {Object} Object for action.\n */\nexport function fetchFromAPI( path, parse ) {\n\treturn {\n\t\ttype: types.FETCH_FROM_API,\n\t\tpath,\n\t\tparse,\n\t};\n};\n\n/**\n * Returns an action object used to get media from the API.\n *\n * @param {Promise} response the API respose.\n * @return {Object} Object for action.\n */\nexport function getFromAPI( response ) {\n\treturn {\n\t\ttype: types.GET_FROM_API,\n\t\tresponse,\n\t};\n};\n\n/**\n * Returns an action object used to create media via the API.\n *\n * @param {string} path Endpoint path.\n * @param {Object} data The data to be created.\n * @return {Object} Object for action.\n */\nexport function createFromAPI( path, data ) {\n\treturn {\n\t\ttype: types.CREATE_FROM_API,\n\t\tpath,\n\t\tdata,\n\t};\n};\n\n/**\n * Returns an action object used to update media via the API.\n *\n * @param {string} path Endpoint path.\n * @param {Object} data The data to be updated.\n * @return {Object} Object for action.\n */\n export function updateFromAPI( path, data ) {\n\treturn {\n\t\ttype: types.UPDATE_FROM_API,\n\t\tpath,\n\t\tdata,\n\t};\n};\n\n/**\n * Returns an action object used to delete a media via the API.\n *\n * @param {string} path Endpoint path.\n * @param {Object} data The data to be created.\n * @param {integer} totalBytes The total amount of bytes per delete batches.\n * @return {Object} Object for action.\n */\nexport function deleteFromAPI( path, relativePath, totalBytes ) {\n\treturn {\n\t\ttype: types.DELETE_FROM_API,\n\t\tpath,\n\t\trelativePath,\n\t\ttotalBytes,\n\t};\n};\n\n/**\n * Returns an action object used to switch between Grid & List mode.\n *\n * @param {Boolean} isGrid\n * @returns {Object} Object for action.\n */\nexport function switchDisplayMode( isGrid ) {\n\treturn {\n\t\ttype: types.SWITCH_DISPLAY_MODE,\n\t\tisGrid,\n\t};\n};\n\n/**\n * Returns an action object used to get the logged in user.\n *\n * @param {Object} user Logged In User object.\n * @return {Object} Object for action.\n */\nexport function getLoggedInUser( user ) {\n\treturn {\n\t\ttype: types.GET_LOGGED_IN_USER,\n\t\tuser,\n\t};\n};\n\n/**\n * Returns an action object used to set the displayed user id.\n *\n * @param {integer} userId Displayed user ID.\n * @return {Object} Object for action.\n */\nexport function setDisplayedUserId( userId ) {\n\treturn {\n\t\ttype: types.SET_DISPLAYED_USER_ID,\n\t\tuserId,\n\t};\n};\n\n/**\n * Returns an action object used to get media.\n *\n * @param {Array} files The list of files.\n * @param {String} relativePath The relative path.\n * @param {Object} currentDirectory The current directory.\n * @return {Object} Object for action.\n */\nexport function getMedia( files, relativePath, currentDirectory, pagination ) {\n\treturn {\n\t\ttype: types.GET_MEDIA,\n\t\tfiles,\n\t\trelativePath,\n\t\tcurrentDirectory,\n\t\tpagination,\n\t};\n};\n\n/**\n * Returns an action object used to update the Upload/Directory Form state.\n *\n * @param {Object} params\n * @returns {Object} Object for action.\n */\nexport function updateFormState( params ) {\n\treturn {\n\t\ttype: types.UPDATE_FORM_STATE,\n\t\tparams,\n\t};\n};\n\n/**\n * Prepare a directory to be added to the Tree.\n *\n * @param {Object} directory The medium object.\n * @param {string} parent The parent ID.\n * @returns {Object} The item Tree.\n */\nconst setItemTree = ( directory, parent ) => {\n\tconst itemTree = {\n\t\tid: directory.id,\n\t\tslug: directory.name,\n\t\tname: directory.title,\n\t\tparent: parent,\n\t\tobject: directory.object ? directory.object : 'members',\n\t\treadonly: directory.readonly ? directory.readonly : false,\n\t\tvisibility: directory.visibility ? directory.visibility : 'public',\n\t\ttype: directory.media_type ? directory.media_type : 'folder',\n\t}\n\n\treturn itemTree;\n};\n\n/**\n * Init the directories Tree.\n *\n * @param {array} items The list of media.\n */\nexport function initTree( items ) {\n\tconst tree = select( STORE_KEY ).getTree();\n\tconst directories = filter( items, { 'mime_type': 'inode/directory' } );\n\n\tif ( ! tree.length ) {\n\t\tdirectories.forEach( ( item ) => {\n\t\t\tconst itemTree = setItemTree( item, 0 );\n\t\t\tdispatch( STORE_KEY ).addItemTree( itemTree );\n\t\t} );\n\t}\n};\n\n/**\n * Returns an action object used to add a directory item to the Items tree.\n *\n * @param {Object} item A media item.\n * @return {Object} Object for action.\n */\nexport function addItemTree( item ) {\n\treturn {\n\t\ttype: types.FILL_TREE,\n\t\titem,\n\t};\n};\n\n/**\n * Returns an action object used to remove a directory item from the Items tree.\n *\n * @param {string} itemId A media item ID.\n * @return {Object} Object for action.\n */\n export function removeItemTree( itemId ) {\n\treturn {\n\t\ttype: types.PURGE_TREE,\n\t\titemId,\n\t};\n};\n\n/**\n * Returns an action object used to switch between Selectable & Regular mode.\n *\n * @param {boolean} isSelectable True to switch to Selectable mode. False otherwise.\n * @returns {Object} Object for action.\n */\nexport function toggleSelectable( isSelectable ) {\n\treturn {\n\t\ttype: types.TOGGLE_SELECTABLE,\n\t\tisSelectable,\n\t};\n};\n\n/**\n * Returns an action object used to switch between Selectable & Regular mode.\n *\n * @param {array} ids The list of media ID.\n * @param {boolean} isSelected True if the media is selected. False otherwise.\n * @returns {Object} Object for action.\n */\nexport function toggleMediaSelection( ids, isSelected ) {\n\treturn {\n\t\ttype: types.TOGGLE_MEDIA_SELECTION,\n\t\tids,\n\t\tisSelected,\n\t};\n};\n\n/**\n * Returns an action object used to add a new file to the Media list.\n *\n * @param {object} file The uploaded medium.\n * @returns {Object} Object for action.\n */\nexport function addMedium( file ) {\n\treturn {\n\t\ttype: types.ADD_MEDIUM,\n\t\tfile,\n\t};\n};\n\n/**\n * Returns an action object used to add a new error.\n *\n * @param {object} error The uploaded file which errored.\n * @returns {Object} Object for action.\n */\nexport function addMediumError( error ) {\n\treturn {\n\t\ttype: types.ADD_ERROR,\n\t\terror,\n\t};\n};\n\n/**\n * Creates a Medium uploading a file.\n *\n * @param {Object} file The file object to upload.\n * @param {integer} totalBytes The total amount of bytes per upload batches.\n * @returns {Object} Object for action.\n */\nexport function * createMedium( file, totalBytes ) {\n\tlet uploading = true, upload;\n\tconst store = select( STORE_KEY );\n\tconst { object, item, visibility } = store.getDestinationData();\n\tconst relativePath = store.getRelativePath();\n\n\tyield { type: 'UPLOAD_START', uploading, file };\n\n\tconst formData = new FormData();\n\tformData.append( 'file', file );\n\tformData.append( 'action', 'bp_attachments_media_upload' );\n\tformData.append( 'object', object );\n\tformData.append( 'object_item', item );\n\n\tif ( visibility ) {\n\t\tformData.append( 'visibility', visibility );\n\t}\n\n\tif ( totalBytes ) {\n\t\tformData.append( 'total_bytes', totalBytes );\n\t}\n\n\tif ( trim( relativePath, '/' ) !== visibility + '/' + object + '/' + item ) {\n\t\tlet uploadRelativePath = relativePath;\n\n\t\t// Private uploads are stored out of the site's uploads dir.\n\t\tif ( 'private' === visibility ) {\n\t\t\tuploadRelativePath = relativePath.replace( '/private', '' );\n\t\t}\n\n\t\tformData.append( 'parent_dir', uploadRelativePath );\n\t}\n\n\tuploading = false;\n\ttry {\n\t\tupload = yield createFromAPI( '/buddypress/v1/attachments', formData );\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\n\t\treturn addMedium( upload );\n\t} catch ( error ) {\n\t\tupload = {\n\t\t\tid: uniqueId(),\n\t\t\tname: file.name,\n\t\t\terror: error.message,\n\t\t\tuploaded: false,\n\t\t};\n\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\n\t\treturn addMediumError( upload );\n\t}\n};\n\n/**\n * Creates a new directory, photo album, audio or video playluist.\n *\n * @todo to avoid too much code duplication, createDirectory & createMedium should probably be\n * gathered into one function.\n *\n * @param {Object} directory The data to use create the directory\n * @returns {Object} Object for action.\n */\nexport function * createDirectory( directory ) {\n\tlet uploading = true, upload;\n\n\t// A directory is handled as a file having the inode/directory mime type.\n\tlet file = {\n\t\tname: directory.directoryName,\n\t\ttype: directory.directoryType,\n\t};\n\n\tconst store = select( STORE_KEY );\n\tconst { object, item, visibility } = store.getDestinationData();\n\tconst relativePath = store.getRelativePath();\n\n\tyield { type: 'UPLOAD_START', uploading, file };\n\n\tconst formData = new FormData();\n\tformData.append( 'directory_name', file.name );\n\tformData.append( 'directory_type', file.type );\n\tformData.append( 'action', 'bp_attachments_make_directory' );\n\tformData.append( 'object', object );\n\tformData.append( 'object_item', item );\n\n\tif ( visibility ) {\n\t\tformData.append( 'visibility', visibility );\n\t}\n\n\tif ( trim( relativePath, '/' ) !== visibility + '/' + object + '/' + item ) {\n\t\tlet createDirRelativePath = relativePath;\n\n\t\t// Private uploads are stored out of the site's uploads dir.\n\t\tif ( 'private' === visibility ) {\n\t\t\tcreateDirRelativePath = relativePath.replace( '/private', '' );\n\t\t}\n\n\t\tformData.append( 'parent_dir', createDirRelativePath );\n\t}\n\n\tuploading = false;\n\ttry {\n\t\tupload = yield createFromAPI( '/buddypress/v1/attachments', formData );\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\t\tupload.uploaded = true;\n\n\t\tconst currentDir = store.getCurrentDirectoryObject();\n\t\tconst itemTree = setItemTree( upload, currentDir.id );\n\n\t\t// Add the directory to the tree.\n\t\tyield addItemTree( itemTree );\n\n\t\treturn addMedium( upload );\n\t} catch ( error ) {\n\t\tupload = {\n\t\t\tid: uniqueId(),\n\t\t\tname: file.name,\n\t\t\terror: error.message,\n\t\t\tuploaded: false,\n\t\t};\n\n\t\tyield { type: 'UPLOAD_END', uploading, file };\n\n\t\treturn addMediumError( upload );\n\t}\n};\n\n/**\n * Updates a Medium.\n *\n * @param {Object} medium The medium object to update.\n * @returns {Object} Object for action.\n */\nexport function * updateMedium( medium ) {\n\tlet update;\n\tconst store = select( STORE_KEY );\n\tconst relativePath = store.getRelativePath();\n\n\ttry {\n\t\tupdate = yield updateFromAPI(\n\t\t\t'/buddypress/v1/attachments/' + medium.id + '/',\n\t\t\t{\n\t\t\t\t'relative_path': relativePath,\n\t\t\t\ttitle: medium.title,\n\t\t\t\tdescription: medium.description,\n\t\t\t}\n\t\t);\n\n\t\tif ( !! medium.selected ) {\n\t\t\tupdate.selected = true;\n\t\t}\n\n\t\treturn addMedium( update );\n\t} catch ( error ) {\n\t\tupdate = {\n\t\t\tid: uniqueId(),\n\t\t\tname: medium.name,\n\t\t\terror: error.message,\n\t\t\tupdated: false,\n\t\t};\n\n\t\treturn addMediumError( update );\n\t}\n};\n\n/**\n * Parses the request response and edit Media store.\n *\n * @param {Object} response The request response.\n * @param {String} relativePath The relative path of the medium.\n * @param {String} parent The parent directory.\n * @param {Object} pagination The request pagination.\n * @returns {void}\n */\nexport const parseResponseMedia = async ( response, relativePath, parent = '', pagination ) => {\n\tconst items = await response.json().then( ( data ) => {\n\t\tdata.forEach( ( item ) => {\n\t\t\titem.parent = parent;\n\n\t\t\tif ( 'inode/directory' === item.mime_type ) {\n\t\t\t\tconst itemTree = setItemTree( item, 0 === item.id.indexOf( 'member-' ) ? 0 : parent );\n\t\t\t\tdispatch( STORE_KEY ).addItemTree( itemTree );\n\t\t\t}\n\t\t} );\n\n\t\treturn data;\n\t} );\n\n\t// Init the Tree when needed.\n\tif ( ! relativePath && ! parent && 1 === parseInt( pagination.membersPage, 10 ) ) {\n\t\tinitTree( items );\n\t}\n\n\tdispatch( STORE_KEY ).getMedia( items, relativePath, parent, pagination );\n};\n\n/**\n * Requests media according to specific arguments.\n *\n * @param {Object} args The Media request arguments.\n * @returns {void}\n */\nexport function * requestMedia( args = {} ) {\n\tconst path = '/buddypress/v1/attachments';\n\tconst displayedUserId = select( STORE_KEY ).getDisplayedUserId();\n\tlet querying = true;\n\tlet relativePathHeader = '';\n\tlet parent = '';\n\tlet pagination = {};\n\n\tyield { type: 'SET_QUERY_STATUS', querying };\n\n\tif ( ! args.context ) {\n\t\targs.context = select( STORE_KEY ).getRequestsContext();\n\t}\n\n\tif ( args.directory && args.path ) {\n\t\targs.directory = trimEnd( args.path, '/' ) + '/' + args.directory;\n\t}\n\n\tif ( args.parent ) {\n\t\tparent = args.parent;\n\t\tdelete args.parent;\n\t}\n\n\tif ( !! displayedUserId ) {\n\t\targs.user_id = displayedUserId;\n\t}\n\n\tdelete args.path;\n\n\tconst response = yield fetchFromAPI( addQueryArgs( path, args ), false );\n\tquerying = false;\n\n\tif ( hasIn( response, [ 'headers', 'get' ] ) ) {\n\t\t// If the request is fetched using the fetch api, the header can be\n\t\t// retrieved using the 'get' method.\n\t\trelativePathHeader = response.headers.get( 'X-BP-Attachments-Relative-Path' );\n\t\tpagination = {\n\t\t\tmembersDisplayedAmount: response.headers.get( 'X-BP-Attachments-Media-Libraries-Total' ),\n\t\t\ttotalMembersPage: response.headers.get( 'X-BP-Attachments-Media-Libraries-TotalPages' ),\n\t\t};\n\t} else {\n\t\t// If the request was preloaded server-side and is returned by the\n\t\t// preloading middleware, the header will be a simple property.\n\t\trelativePathHeader = get( response, [ 'headers', 'X-BP-Attachments-Relative-Path' ], '' );\n\t\tpagination = {\n\t\t\tmembersDisplayedAmount: get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-Total' ], 0 ),\n\t\t\ttotalMembersPage: get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-TotalPages' ], 0 ),\n\t\t};\n\t}\n\n\tif ( !! pagination.totalMembersPage ) {\n\t\tpagination.membersPage = ! args.page ? 1 : parseInt( args.page, 10 );\n\t}\n\n\tyield { type: 'SET_QUERY_STATUS', querying };\n\treturn parseResponseMedia( response, relativePathHeader, parent, pagination );\n};\n\n/**\n * Returns an action object used to remove a medium from the state.\n *\n * @param {integer} id The medium ID.\n * @returns {Object} Object for action.\n */\nexport function removeMedium( id ) {\n\treturn {\n\t\ttype: 'REMOVE_MEDIUM',\n\t\tid,\n\t}\n};\n\n/**\n * Deletes a Medium removing the file from the server's filesystem.\n *\n * @param {Object} file The file object to upload.\n * @param {integer} totalBytes The total amount of bytes per delete batches.\n * @returns {Object} Object for action.\n */\nexport function * deleteMedium( file, totalBytes ) {\n\tconst store = select( STORE_KEY );\n\tconst relativePath = store.getRelativePath();\n\tlet deleted;\n\n\ttry {\n\t\tdeleted = yield deleteFromAPI( '/buddypress/v1/attachments/' + file.id + '/', relativePath, totalBytes );\n\n\t\tif ( 'inode/directory' === deleted.previous.mime_type ) {\n\t\t\tyield removeItemTree( deleted.previous.id );\n\t\t}\n\n\t\treturn removeMedium( deleted.previous.id );\n\t} catch ( error ) {\n\t\tfile.error = error.message;\n\n\t\treturn addMediumError( file );\n\t}\n};\n\n/**\n * Returns an action object used to remove an error.\n *\n * @param {integer} errorID The error ID.\n * @returns {Object} Object for action.\n */\nexport function removeMediumError( errorID ) {\n\treturn {\n\t\ttype: types.REMOVE_ERROR,\n\t\terrorID,\n\t};\n};\n","/**\n * External dependencies.\n */\nconst {\n\tget,\n\thasIn,\n} = lodash;\n\n/**\n * Internal dependencies.\n */\nimport {\n\tfetchFromAPI,\n\tgetFromAPI,\n\tinitTree,\n\tgetLoggedInUser as getLoggedInUserAction,\n\tgetMedia as getMediaAction,\n} from './actions';\n\n/**\n * Returns the request context.\n *\n * @access private\n * @returns {string} The request context (view or edit).\n */\nconst _requestContext = () => {\n\tconst { isAdminScreen } = window.bpAttachmentsMediaLibrarySettings || {};\n\treturn isAdminScreen && true === isAdminScreen ? 'edit' : 'view';\n};\n\n/**\n * Resolver for retrieving current user.\n */\nexport function* getLoggedInUser() {\n\tconst path = '/buddypress/v1/members/me?context=edit';\n\tconst user = yield fetchFromAPI( path, true );\n\tyield getLoggedInUserAction( user );\n};\n\n/**\n * Resolver for retrieving the current user media library or all user media libraries.\n */\nexport function* getMedia() {\n\tconst path = '/buddypress/v1/attachments?context=' + _requestContext();\n\tconst response = yield fetchFromAPI( path, false );\n\tconst files = yield getFromAPI( response );\n\tlet pagination = {\n\t\tmembersPage: 1,\n\t};\n\n\tif ( hasIn( response, [ 'headers', 'get' ] ) ) {\n\t\tpagination.membersDisplayedAmount = parseInt( response.headers.get( 'X-BP-Attachments-Media-Libraries-Total' ), 10 );\n\t\tpagination.totalMembersPage = parseInt( response.headers.get( 'X-BP-Attachments-Media-Libraries-TotalPages' ), 10 );\n\t} else {\n\t\tpagination.membersDisplayedAmount = parseInt( get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-Total' ], 0 ), 10 );\n\t\tpagination.totalMembersPage = parseInt( get( response, [ 'headers', 'X-BP-Attachments-Media-Libraries-TotalPages' ], 0 ), 10 );\n\t}\n\n\tinitTree( files );\n\n\tyield getMediaAction( files, '', '', pagination );\n};\n","/**\n * External dependencies.\n */\n const {\n\treject,\n} = lodash;\n\n/**\n * Internal dependencies\n */\nimport { TYPES as types } from './action-types';\n\n/**\n * Default state.\n */\nconst DEFAULT_STATE = {\n\tuser: {},\n\tdisplayedUserId: 0,\n\ttree: [],\n\tcurrentDirectory: '',\n\tfiles: [],\n\trelativePath: '',\n\tuploads: [],\n\terrors: [],\n\tuploading: false,\n\tended: false,\n\tisSelectable: false,\n\tisGrid: true,\n\tsettings: {},\n\tformState: {},\n\tpagination: {\n\t\tmembersPage: 1,\n\t\tmembersDisplayedAmount: 0,\n\t\ttotalMembersPage: 0,\n\t},\n\tquerying: false,\n};\n\n/**\n * Reducer for the BP Attachments Library.\n *\n * @param {Object} state The current state in the store.\n * @param {Object} action Action object.\n *\n * @return {Object} New or existing state.\n */\n const reducer = ( state = DEFAULT_STATE, action ) => {\n\tswitch ( action.type ) {\n\t\tcase types.SET_SETTINGS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tsettings: action.settings,\n\t\t\t};\n\n\t\tcase types.GET_LOGGED_IN_USER:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuser: action.user,\n\t\t\t};\n\n\t\tcase types.SET_DISPLAYED_USER_ID:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tdisplayedUserId: parseInt( action.userId, 10 ),\n\t\t\t};\n\n\t\tcase types.GET_MEDIA:\n\t\t\tlet media = [];\n\t\t\tif ( action.pagination.membersPage && 1 < action.pagination.membersPage ) {\n\t\t\t\tmedia = [ ...state.files, ...action.files ];\n\t\t\t} else {\n\t\t\t\tmedia = action.files;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: media,\n\t\t\t\trelativePath: action.relativePath,\n\t\t\t\tcurrentDirectory: action.currentDirectory,\n\t\t\t\tpagination: {\n\t\t\t\t\t...action.pagination\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase types.FILL_TREE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttree: [\n\t\t\t\t\t...reject( state.tree, [ 'id', action.item.id ] ),\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.PURGE_TREE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\ttree: reject( state.tree, [ 'id', action.itemId ] ),\n\t\t\t};\n\n\t\tcase types.UPDATE_FORM_STATE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tformState: {\n\t\t\t\t\t...action.params\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase types.ADD_MEDIUM:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: [\n\t\t\t\t\t...reject( state.files, [ 'id', action.file.id ] ),\n\t\t\t\t\taction.file,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.UPLOAD_START:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuploading: action.uploading,\n\t\t\t\tuploads: [\n\t\t\t\t\t...state.uploads,\n\t\t\t\t\taction.file,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.ADD_ERROR:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\terrors: [\n\t\t\t\t\t...state.errors,\n\t\t\t\t\taction.error,\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.REMOVE_ERROR:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\terrors: reject( state.errors, [ 'id', action.errorID ] ),\n\t\t\t};\n\n\t\tcase types.UPLOAD_END:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuploading: action.uploading,\n\t\t\t\tuploads: reject( state.uploads, ( u ) => { return u.name === action.file.name; } ),\n\t\t\t\tended: true,\n\t\t\t};\n\n\t\tcase types.RESET_UPLOADS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tuploading: false,\n\t\t\t\tuploads: [],\n\t\t\t\terrors:[],\n\t\t\t\tended: false,\n\t\t\t};\n\n\t\tcase types.TOGGLE_SELECTABLE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisSelectable: action.isSelectable,\n\t\t\t};\n\n\t\tcase types.TOGGLE_MEDIA_SELECTION:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: state.files.map( file => {\n\t\t\t\t\tif ( ( 'all' === action.ids[0] && ! action.isSelected ) || ( -1 !== action.ids.indexOf( file.id ) ) ) {\n\t\t\t\t\t\tfile.selected = action.isSelected;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t\t} ),\n\t\t\t};\n\n\t\tcase types.SWITCH_DISPLAY_MODE:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisGrid: action.isGrid,\n\t\t\t};\n\n\t\tcase types.REMOVE_MEDIUM:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tfiles: [\n\t\t\t\t\t...reject( state.files, [ 'id', action.id ] )\n\t\t\t\t],\n\t\t\t};\n\n\t\tcase types.SET_QUERY_STATUS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tquerying: action.querying,\n\t\t\t};\n\t}\n\n\treturn state;\n};\n\nexport default reducer;\n","/**\n * WordPress dependencies.\n */\nconst {\n\tapiFetch,\n} = wp;\n\n/**\n * Default export for registering the controls with the store.\n *\n * @return {Object} An object with the controls to register with the store on\n * the controls property of the registration object.\n */\nexport const controls = {\n\tFETCH_FROM_API( { path, parse } ) {\n\t\treturn apiFetch( { path, parse } );\n\t},\n\tGET_FROM_API( { response } ) {\n\t\treturn response.json();\n\t},\n\tCREATE_FROM_API( { path, data } ) {\n\t\treturn apiFetch(\n\t\t\t{\n\t\t\t\tpath: path,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: data\n\t\t\t}\n\t\t);\n\t},\n\tUPDATE_FROM_API( { path, data } ) {\n\t\treturn apiFetch(\n\t\t\t{\n\t\t\t\tpath: path,\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tdata: data\n\t\t\t}\n\t\t);\n\t},\n\tDELETE_FROM_API( { path, relativePath, totalBytes } ) {\n\t\treturn apiFetch(\n\t\t\t{\n\t\t\t\tpath: path,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\tdata: {\n\t\t\t\t\trelative_path: relativePath,\n\t\t\t\t\ttotal_bytes: totalBytes,\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n};\n","/**\n * WordPress dependencies.\n */\n const {\n\tdata: {\n\t\tregisterStore,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { STORE_KEY } from './constants';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\nimport reducer from './reducers';\nimport { controls } from './controls';\n\nregisterStore( STORE_KEY, {\n\treducer,\n\tactions,\n\tselectors,\n\tcontrols,\n\tresolvers,\n} );\n\nexport const BP_ATTACHMENTS_STORE_KEY = STORE_KEY;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tPopover,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Header element.\n */\nconst MediaLibraryHeader = ( { settings } ) => {\n\tconst { updateFormState } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst {\n\t\tcurrentDirectoryObject,\n\t\tuser,\n\t\tdisplayedUserId,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tcurrentDirectoryObject: store.getCurrentDirectoryObject(),\n\t\t\tuser: store.getLoggedInUser(),\n\t\t\tdisplayedUserId: store.getDisplayedUserId(),\n\t\t};\n\t}, [] );\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst toggleClass = true === isOpen ? 'split-button is-open' : 'split-button';\n\tconst dashiconClass = true === isOpen ? 'dashicons dashicons-arrow-up-alt2' : 'dashicons dashicons-arrow-down-alt2';\n\tconst canUpload = true !== currentDirectoryObject.readonly && ( ! displayedUserId || displayedUserId === user.id );\n\tconst { allowedExtByMediaList, isAdminScreen } = settings;\n\tconst hrClass = isAdminScreen ? 'wp-header-end' : 'screen-header-end';\n\tconst pageTitle = !! user.capabilities && -1 !== user.capabilities.indexOf( 'bp_moderate' ) ? __( 'Community Media Libraries', 'bp-attachments' ) : __( 'Community Media Library', 'bp-attachments' );\n\n\tconst showUploadForm = ( e ) => {\n\t\te.preventDefault();\n\n\t\treturn updateFormState(\n\t\t\t{\n\t\t\t\tparentDirectory: currentDirectoryObject.id,\n\t\t\t\taction: 'upload',\n\t\t\t}\n\t\t);\n\t};\n\n\tconst showCreateDirForm = ( e, type ) => {\n\t\te.preventDefault();\n\n\t\treturn updateFormState(\n\t\t\t{\n\t\t\t\tparentDirectory: currentDirectoryObject.id,\n\t\t\t\taction: 'createDirectory',\n\t\t\t\tdirectoryType: type,\n\t\t\t}\n\t\t);\n\t};\n\n\tlet dirOptions = [];\n\tconst directoryTypes = [ 'album', 'audio_playlist', 'video_playlist' ];\n\n\tif ( ! currentDirectoryObject.type || -1 === directoryTypes.indexOf( currentDirectoryObject.type ) ) {\n\t\tdirOptions = [\n\t\t\t{\n\t\t\t\tid: 'folder',\n\t\t\t\ttext: __( 'Add new directory', 'bp-attachments' ),\n\t\t\t}\n\t\t];\n\n\t\tif ( allowedExtByMediaList && 'private' !== currentDirectoryObject.visibility ) {\n\t\t\tObject.keys( allowedExtByMediaList ).forEach( ( directoryType ) => {\n\t\t\t\tif ( 'album' === directoryType ) {\n\t\t\t\t\tdirOptions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'album',\n\t\t\t\t\t\t\ttext: __( 'Add new photo album', 'bp-attachments' ),\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else if ( 'audio_playlist' === directoryType ) {\n\t\t\t\t\tdirOptions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'audio_playlist',\n\t\t\t\t\t\t\ttext: __( 'Add new audio playlist', 'bp-attachments' ),\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else if ( 'video_playlist' === directoryType ) {\n\t\t\t\t\tdirOptions.push(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: 'video_playlist',\n\t\t\t\t\t\t\ttext: __( 'Add new video playlist', 'bp-attachments' ),\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst dirList = dirOptions.map( ( dirOption ) => {\n\t\treturn (\n\t\t\t
  • \n\t\t\t\t showCreateDirForm( e, dirOption.id ) }>\n\t\t\t\t\t{ dirOption.text }\n\t\t\t\t\n\t\t\t
  • \n\t\t);\n\t} );\n\n\treturn (\n\t\t\n\t\t\t{ !! isAdminScreen && (\n\t\t\t\t

    \n\t\t\t\t\t{ pageTitle }\n\t\t\t\t

    \n\t\t\t) }\n\n\t\t\t{ ! isAdminScreen && (\n\t\t\t\t

    \n\t\t\t\t\t{ __( 'Library', 'bp-attachments' ) }\n\t\t\t\t

    \n\t\t\t) }\n\n\t\t\t{ !! canUpload && (\n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t showUploadForm( e ) }>\n\t\t\t\t\t\t\t{ __( 'Add new', 'bp-attachments' ) }\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t) }\n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default MediaLibraryHeader;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tDropZone,\n\t\tFormFileUpload,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport { bytesToSize } from '../utils/functions';\n\n/**\n * File Uploader element.\n */\nconst MediaLibraryUploader = ( { settings } ) => {\n\tconst { maxUploadFileSize, allowedExtTypes, allowedExtByMediaList } = settings;\n\tconst { updateFormState, createMedium } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst { formState, currentDirectoryObject } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY )\n\t\treturn {\n\t\t\tformState: store.getFormState(),\n\t\t\tcurrentDirectoryObject: store.getCurrentDirectoryObject(),\n\t\t}\n\t}, [] );\n\n\tconst resetFormState = () => {\n\t\tformState.action = '';\n\t\tupdateFormState( formState );\n\t}\n\n\tconst closeForm = ( e ) => {\n\t\te.preventDefault();\n\t\tresetFormState();\n\t};\n\n\tconst uploadMedia = ( files ) => {\n\t\tlet media;\n\t\tlet bytes = 0;\n\n\t\tif ( files.currentTarget && files.currentTarget.files ) {\n\t\t\tmedia = [ ...files.currentTarget.files ];\n\t\t} else {\n\t\t\tmedia = files;\n\t\t}\n\n\t\tlet numMedia = media.length;\n\n\t\tmedia.forEach( ( medium ) => {\n\t\t\tbytes += parseInt( medium.size, 10 );\n\t\t\tnumMedia -= 1;\n\n\t\t\tconst totalBytes = 0 === numMedia ? bytes : 0;\n\t\t\tcreateMedium( medium, totalBytes );\n\t\t} );\n\n\t\tresetFormState();\n\t};\n\n\tif ( ! formState.action || 'upload' !== formState.action ) {\n\t\treturn null;\n\t}\n\n\tlet allowedExts = allowedExtTypes;\n\tconst directoryTypes = [ 'album', 'audio_playlist', 'video_playlist' ];\n\n\tif ( currentDirectoryObject.type && -1 !== directoryTypes.indexOf( currentDirectoryObject.type ) ) {\n\t\tallowedExts = allowedExtByMediaList[ currentDirectoryObject.type ];\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t uploadMedia( files ) }\n\t\t\t\tclassName=\"uploader-inline\"\n\t\t\t/>\n\t\t\t\n\t\t\t
    \n\t\t\t\t

    { __( 'Drop files to upload', 'bp-attachments' ) }

    \n\t\t\t\t

    { __( 'or', 'bp-attachments' ) }

    \n\t\t\t\t uploadMedia( files ) }\n\t\t\t\t\tmultiple={ true }\n\t\t\t\t\taccept={ allowedExts }\n\t\t\t\t\tclassName=\"browser button button-hero\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Select Files', 'bp-attachments' ) }\n\t\t\t\t\n\t\t\t
    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t{\n\t\t\t\t\t/* translators: %s is the max size allowed for a media file */\n\t\t\t\t\tsprintf( __( 'Maximum upload file size: %s.', 'bp-attachments' ), bytesToSize( maxUploadFileSize ) )\n\t\t\t\t}\n\t\t\t\t

    \n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default MediaLibraryUploader;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tButton,\n\t\tTextControl,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Directory Creator element.\n */\nconst MediaLibraryDirectoryCreator = () => {\n\tconst [ directoryName, setDirectoryName ] = useState( '' );\n\tconst { updateFormState, createDirectory } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst formState = useSelect( ( select ) => {\n\t\treturn select( BP_ATTACHMENTS_STORE_KEY ).getFormState();\n\t}, [] );\n\n\tconst resetFormState = () => {\n\t\tformState.action = '';\n\t\tformState.directoryType = '';\n\t\treturn updateFormState( formState );\n\t}\n\n\tconst closeForm = ( e ) => {\n\t\te.preventDefault();\n\t\tresetFormState();\n\t};\n\n\tconst makeDirectory = ( e ) => {\n\t\te.preventDefault();\n\n\t\tconst directory = {\n\t\t\tdirectoryName: directoryName,\n\t\t\tdirectoryType: formState.directoryType,\n\t\t};\n\n\t\tcreateDirectory( directory );\n\t\tsetDirectoryName( '' );\n\t\tresetFormState();\n\t};\n\n\tif ( ! formState.action || 'createDirectory' !== formState.action ) {\n\t\treturn null;\n\t}\n\n\tlet title = __( 'Create a new directory', 'bp-attachments' );\n\tlet nameLabel = __( 'Type a name for your directory', 'bp-attachments' );\n\tlet buttonLabel = __( 'Save directory', 'bp-attachments' );\n\n\tif ( 'album' === formState.directoryType ) {\n\t\ttitle = __( 'Create a new photo album', 'bp-attachments' );\n\t\tnameLabel = __( 'Type a name for your photo album', 'bp-attachments' );\n\t\tbuttonLabel = __( 'Save photo album', 'bp-attachments' );\n\t} else if ( 'audio_playlist' === formState.directoryType ) {\n\t\ttitle = __( 'Create a new audio playlist', 'bp-attachments' );\n\t\tnameLabel = __( 'Type a name for your audio playlist', 'bp-attachments' );\n\t\tbuttonLabel = __( 'Save audio playlist', 'bp-attachments' );\n\t} else if ( 'video_playlist' === formState.directoryType ) {\n\t\ttitle = __( 'Create a new video playlist', 'bp-attachments' );\n\t\tnameLabel = __( 'Type a name for your video playlist', 'bp-attachments' );\n\t\tbuttonLabel = __( 'Save video playlist', 'bp-attachments' );\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t\n\t\t\t

    { title }

    \n\t\t\t setDirectoryName( directoryName ) }\n\t\t\t/>\n\t\t\t\n\t\t\n\t);\n}\n\nexport default MediaLibraryDirectoryCreator;\n","/**\n * WordPress dependencies\n */\n const {\n\tcomponents: {\n\t\tButton,\n\t\tExternalLink,\n\t\tTextareaControl,\n\t\tTextControl,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\nconst EditMediaItem = ( { medium, errorCallback } ) => {\n\tconst {\n\t\tid,\n\t\tname,\n\t\ttitle,\n\t\tdescription,\n\t\ticon,\n\t\tmedia_type,\n\t\tmime_type,\n\t\tvisibility,\n\t\tselected,\n\t\tlinks: {\n\t\t\tview,\n\t\t\tdownload,\n\t\t\tsrc\n\t\t},\n\t} = medium;\n\tconst [ editedMedium, editMedium ] = useState( {\n\t\ttitle: title,\n\t\tdescription: description,\n\t} );\n\tconst { updateMedium } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst isDisabled = title === editedMedium.title && description === editedMedium.description;\n\tconst hasNoPreview = -1 === [ 'image', 'video', 'audio' ].indexOf( media_type ) || 'private' === visibility;\n\tconst isDirectory = 'inode/directory' === mime_type;\n\tlet contentClasses = [ 'bp-attachment-edit-item__preview_content' ];\n\tif ( ! hasNoPreview ) {\n\t\tcontentClasses.push( 'has-rich-preview' );\n\t}\n\tif ( isDirectory ) {\n\t\tcontentClasses.push( 'is-directory' );\n\t}\n\n\tconst saveMediumProps = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tupdateMedium( {\n\t\t\tid: id,\n\t\t\tname: name,\n\t\t\ttitle: editedMedium.title,\n\t\t\tdescription: editedMedium.description,\n\t\t\tselected: selected,\n\t\t} ).then( ( response ) => {\n\t\t\tif ( response.error ) {\n\t\t\t\terrorCallback( false );\n\t\t\t} else if ( response.file ) {\n\t\t\t\teditMedium( {\n\t\t\t\t\t...editedMedium,\n\t\t\t\t\ttitle: response.file.title,\n\t\t\t\t\tdescription: response.file.description,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\tconst resetMediumProps = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\teditMedium( {\n\t\t\t...editedMedium,\n\t\t\ttitle: title,\n\t\t\tdescription: description,\n\t\t} );\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t
    \n\t\t\t\t

    { editedMedium.title }

    \n\t\t\t\t
      \n\t\t\t\t\t
    • { isDirectory ? __( 'Open directory page', 'bp-attachments' ) : __( 'Open media page', 'bp-attachments' ) }
    • \n\t\t\t\t\t{ ! isDirectory && (\n\t\t\t\t\t\t
    • { __( 'Download media', 'bp-attachments' ) }
    • \n\t\t\t\t\t) }\n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t{ hasNoPreview && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 'image' === media_type && src && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 'audio' === media_type && src && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 'video' === media_type && src && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t) }\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t

    { editedMedium.description }

    \n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t\t
    \n\t\t\t\t

    \n\t\t\t\t\t{\n\t\t\t\t\t\t/* translators: %s is the media name */\n\t\t\t\t\t\tsprintf( __( 'Edit %s', 'bp-attachments' ), name )\n\t\t\t\t\t}\n\t\t\t\t

    \n\t\t\t\t

    { __( 'Use the below fields to edit media properties.', 'bp-attachments' ) }

    \n\t\t\t\t editMedium( { ...editedMedium, title: value } ) }\n\t\t\t\t\thelp={ __( 'Change the title of your medium to something more descriptive then its file name.', 'bp-attachments' ) }\n\t\t\t\t/>\n\t\t\t\t editMedium( { ...editedMedium, description: text } ) }\n\t\t\t\t\thelp={ __( 'Add or edit the description of your medium to tell your story about it.', 'bp-attachments' ) }\n\t\t\t\t/>\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default EditMediaItem;\n","/**\n * External dependencies.\n */\nconst {\n\tfind,\n\treverse,\n\tfilter,\n} = lodash;\n\n/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tButton,\n\t\tModal,\n\t\tTreeSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tuseState,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\thooks: {\n\t\tapplyFilters,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport { getDirectoryAncestors } from '../utils/functions';\nimport EditMediaItem from './edit-item';\n\n/**\n * Toolbar element.\n */\nconst MediaLibraryToolbar = ( { gridDisplay } ) => {\n\tconst {\n\t\tswitchDisplayMode,\n\t\trequestMedia,\n\t\ttoggleSelectable,\n\t\ttoggleMediaSelection,\n\t\tdeleteMedium,\n\t\tsetDisplayedUserId,\n\t} = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst {\n\t\tuser,\n\t\tdisplayedUserId,\n\t\tcurrentDirectory,\n\t\tcurrentDirectoryObject,\n\t\tflatTree,\n\t\ttree,\n\t\tisSelectable,\n\t\tselectedMedia,\n\t\tsettings,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY )\n\t\treturn {\n\t\t\tuser: store.getLoggedInUser(),\n\t\t\tdisplayedUserId: store.getDisplayedUserId(),\n\t\t\tcurrentDirectory: store.getCurrentDirectory(),\n\t\t\tcurrentDirectoryObject: store.getCurrentDirectoryObject(),\n\t\t\tflatTree: store.getFlatTree(),\n\t\t\ttree: store.getTree(),\n\t\t\tisSelectable: store.isSelectable(),\n\t\t\tselectedMedia: store.selectedMedia(),\n\t\t\tsettings: store.getSettings(),\n\t\t}\n\t}, [] );\n\tconst [ page, setPage ] = useState( currentDirectory );\n\tconst [ isOpen, toggleModal ] = useState( false );\n\tconst canSelect = true !== currentDirectoryObject.readonly;\n\tconst hasSelectedMedia = isSelectable && selectedMedia.length !== 0;\n\tconst hasOneSelectedMedia = isSelectable && selectedMedia.length === 1;\n\tconst canModerate = !! settings.isAdminScreen && !! user.capabilities && -1 !== user.capabilities.indexOf( 'bp_moderate' );\n\n\tif ( currentDirectory !== page ) {\n\t\tsetPage( currentDirectory );\n\t}\n\n\tconst switchMode = ( e, isGrid ) => {\n\t\te.preventDefault();\n\t\tswitchDisplayMode( isGrid );\n\t};\n\n\tconst changeDirectory = ( directory ) => {\n\t\tsetPage( directory );\n\t\tconst updateDisplayedUserId = 0 === directory.indexOf( 'member-' ) ? parseInt( directory.replace( 'member-', '' ), 10 ) : 0;\n\t\tif ( !! updateDisplayedUserId ) {\n\t\t\tsetDisplayedUserId( updateDisplayedUserId );\n\t\t}\n\n\t\tconst directoryItem = find( flatTree, { id: directory } );\n\t\tlet args = {};\n\n\t\tif ( directoryItem ) {\n\t\t\targs.directory = directoryItem.slug;\n\t\t\targs.parent = directoryItem.id;\n\n\t\t\tif ( directoryItem.parent && directoryItem.object ) {\n\t\t\t\tlet chunks = reverse( getDirectoryAncestors(\n\t\t\t\t\tflatTree,\n\t\t\t\t\tdirectoryItem.parent\n\t\t\t\t).map( ( parent ) => parent.slug ) );\n\n\t\t\t\tif ( 'members' === directoryItem.object ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * In a future release, when Groups will be supported. The root directories will be:\n\t\t\t\t\t * - My Groups Media,\n\t\t\t\t\t * - My Media.\n\t\t\t\t\t *\n\t\t\t\t\t * The \"My Media\" ID is 'member'. We need to remove this from chunks as files are stored in\n\t\t\t\t\t * `/uploads/buddypress/public/members/{userID}` or `../buddypress-private/members/{userID}`.\n\t\t\t\t\t */\n\t\t\t\t\tconst memberIndex = chunks.indexOf( 'member' );\n\t\t\t\t\tif ( -1 !== memberIndex ) {\n\t\t\t\t\t\tchunks.splice( memberIndex, 1 );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( chunks.length ) {\n\t\t\t\t\t\tchunks.splice( 1, 0, directoryItem.object, user.id );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Use this filter to customize the pathArray for other components (eg: groups).\n\t\t\t\t\tchunks = applyFilters(\n\t\t\t\t\t\t'buddypress.Attachments.toolbarTreeSelect.pathArray',\n\t\t\t\t\t\tchunks,\n\t\t\t\t\t\tdirectoryItem,\n\t\t\t\t\t\tuser.id\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\targs.path = '/' + chunks.join( '/' );\n\t\t\t}\n\n\t\t\tif ( directoryItem.object ) {\n\t\t\t\targs.object = directoryItem.object;\n\t\t\t}\n\n\t\t\tif ( !! updateDisplayedUserId || !! displayedUserId ) {\n\t\t\t\targs.user_id = updateDisplayedUserId !== displayedUserId ? updateDisplayedUserId : displayedUserId;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * When changing the selected option to 'All members', reset the displayedUserId.\n\t\t\t * so that the Admin can go back to the list of members.\n\t\t\t */\n\t\t} else if ( !! displayedUserId ) {\n\t\t\tsetDisplayedUserId( 0 );\n\t\t}\n\n\t\treturn requestMedia( args );\n\t};\n\n\tconst onToggleSectable = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst toggle = ! isSelectable;\n\n\t\tif ( ! toggle ) {\n\t\t\ttoggleMediaSelection( ['all'], toggle );\n\t\t}\n\n\t\treturn toggleSelectable( toggle );\n\t};\n\n\tconst onDeleteSelected = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tlet bytes = 0;\n\t\tlet numSelectedMedia = selectedMedia.length;\n\n\t\tselectedMedia.forEach( medium => {\n\t\t\t// Deleted folders do not have a size.\n\t\t\tif ( !! medium.size ) {\n\t\t\t\tbytes += parseInt( medium.size, 10 );\n\t\t\t}\n\n\t\t\tnumSelectedMedia -= 1;\n\n\t\t\tconst totalBytes = 0 === numSelectedMedia ? bytes : 0;\n\t\t\tdeleteMedium( medium, totalBytes );\n\t\t} );\n\n\t\treturn toggleSelectable( false );\n\t};\n\n\tconst onEditSelected = ( event ) => {\n\t\tevent.preventDefault();\n\n\t\ttoggleModal( true );\n\t};\n\n\treturn (\n\t\t
    \n\t\t\t
    \n\t\t\t\t{ ! isSelectable && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ canSelect && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ canSelect && hasOneSelectedMedia && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ canSelect && hasSelectedMedia && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t{ isOpen && (\n\t\t\t\t\t\t toggleModal( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t) }\n\t\t\t
    \n\t\t\t{ !! tree.length && (\n\t\t\t\t
    \n\t\t\t\t\t changeDirectory( directory ) }\n\t\t\t\t\t\tselectedId={ page }\n\t\t\t\t\t\ttree={ ! canModerate ? tree : filter( tree, { id: 'member-' + displayedUserId } ) }\n\t\t\t\t\t/>\n\t\t\t\t
    \n\t\t\t) }\n\t\t
    \n\t);\n};\n\nexport default MediaLibraryToolbar;\n","/**\n * External dependencies\n */\nconst { template } = lodash;\n\nfunction setTemplate( tmpl ) {\n\tconst options = {\n\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\tinterpolate: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g,\n\t\tescape: /\\{\\{([^\\}]+?)\\}\\}(?!\\})/g,\n\t\tvariable: 'data'\n\t};\n\n\treturn template( document.querySelector( '#tmpl-' + tmpl ).innerHTML, options );\n}\n\nexport default setTemplate;\n","/**\n * WordPress dependencies\n */\n const {\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\tcomponents: {\n\t\tModal,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport setTemplate from '../utils/set-template';\nimport EditMediaItem from './edit-item';\n\nconst MediaItem = ( props ) => {\n\tconst {\n\t\tmedium,\n\t\tselected,\n\t\tisGrid,\n\t} = props;\n\tconst Template = !! isGrid ? setTemplate( 'bp-attachments-media-item' ) : setTemplate( 'bp-attachments-list-media-item' );\n\tconst { toggleMediaSelection, requestMedia, setDisplayedUserId } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst [ isOpen, toggleModal ] = useState( false );\n\tconst [ isSelected, selectMedia ] = useState( selected );\n\tconst { getRelativePath, isSelectable } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tgetRelativePath: store.getRelativePath(),\n\t\t\tisSelectable: store.isSelectable(),\n\t\t};\n\t}, [] );\n\n\tif ( ! isSelectable && ! selected && isSelected ) {\n\t\tselectMedia( false );\n\t}\n\n\tconst classes = isSelected ? 'media-item selected' : 'media-item';\n\tconst onMediaClick = () => {\n\t\tconst { mimeType, name, isSelectable, id, object } = props;\n\n\t\tif ( isSelectable ) {\n\t\t\tselectMedia( ! isSelected );\n\t\t\treturn toggleMediaSelection( [ id ], ! isSelected );\n\t\t}\n\n\t\tif ( 'inode/directory' === mimeType ) {\n\t\t\tconst displayedUserId = 0 === id.indexOf( 'member-' ) ? parseInt( id.replace( 'member-', '' ), 10 ) : 0;\n\n\t\t\tif ( !! displayedUserId ) {\n\t\t\t\tsetDisplayedUserId( displayedUserId );\n\t\t\t}\n\n\t\t\treturn requestMedia( { directory: name, path: getRelativePath, object: object, parent: id } );\n\t\t}\n\n\t\ttoggleModal( true );\n\t};\n\n\treturn (\n\t\t\n\t\t\t onMediaClick() }\n\t\t\t/>\n\t\t\t{ isOpen && (\n\t\t\t\t toggleModal( false ) }\n\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t) }\n\t\t\n\t);\n};\n\nexport default MediaItem;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tAnimate,\n\t\tDashicon,\n\t\tNotice,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Notices element.\n */\nconst MediaLibraryNotices = () => {\n\tconst { uploads, errors } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tuploads: store.getUploads(),\n\t\t\terrors: store.getErrors(),\n\t\t};\n\t}, [] );\n\tconst { removeMediumError } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst onRemoveError = ( errorID ) => {\n\t\treturn removeMediumError( errorID );\n\t};\n\n\tlet errorNotices = [];\n\n\tif ( errors && errors.length ) {\n\t\terrorNotices = errors.map( ( error ) => {\n\t\t\treturn (\n\t\t\t\t onRemoveError( error.id ) }\n\t\t\t\t\tisDismissible={ true }\n\t\t\t\t>\n\t\t\t\t\t

    \n\t\t\t\t\t\t\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: 1: file name. 2: error message. */\n\t\t\t\t\t\t\t__( '« %1$s » wasn‘t added to the media library. %2$s', 'bp-attachments' ),\n\t\t\t\t\t\t\terror.name,\n\t\t\t\t\t\t\terror.error\n\t\t\t\t\t\t) }\n\t\t\t\t\t

    \n\t\t\t\t\n\t\t\t);\n\t\t} );\n\t}\n\n\tlet loadingNotice = null;\n\tconst numberUploads = uploads && uploads.length ? uploads.length : 0;\n\n\tif ( !! numberUploads ) {\n\t\t// Looks like WP CLI can't find _n() usage.\n\t\tlet uploadingMedia = __( 'Uploading the media, please wait.', 'bp-attachments' );\n\t\tif ( numberUploads > 1 ) {\n\t\t\t/* translators: %d: number of media being uploaded. */\n\t\t\tuploadingMedia = sprintf( __( 'Uploading %d media, please wait.', 'bp-attachments' ), numberUploads );\n\t\t}\n\n\t\tloadingNotice = (\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\t{ ( { className } ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t

    \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{ uploadingMedia }\n\t\t\t\t\t\t\t

    \n\t\t\t\t\t\t\n\t\t\t\t\t) }\n\t\t\t\t\n\t\t\t
    \n\t\t);\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t{ loadingNotice }\n\t\t\t{ errorNotices }\n\t\t
    \n\t);\n}\n\nexport default MediaLibraryNotices;\n","/**\n * WordPress dependencies\n */\nconst {\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\nimport MediaItem from './item';\nimport MediaLibraryNotices from './notices';\nimport { bytesToSize } from '../utils/functions';\n\n/**\n * Main element.\n */\nconst MediaLibraryMain = ( { gridDisplay } ) => {\n\tconst { items, isSelectable } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\titems: store.getMedia(),\n\t\t\tisSelectable: store.isSelectable(),\n\t\t};\n\t}, [] );\n\tconst modeClass = true === gridDisplay ? ' grid' : ' list';\n\n\tlet mediaItems = null;\n\tif ( items.length ) {\n\t\tmediaItems = items.map( ( item ) => {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t} );\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t\n\t\t\t
    \n\t\t\t\t{ mediaItems }\n\t\t\t\t{ ! items.length && (\n\t\t\t\t\t

    { __( 'No community media items found.', 'bp-attachments' ) }

    \n\t\t\t\t) }\n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default MediaLibraryMain;\n","/**\n * WordPress dependencies\n */\nconst {\n\tcomponents: {\n\t\tButton,\n\t\tSpinner,\n\t},\n\tdata: {\n\t\tuseDispatch,\n\t\tuseSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from '../store';\n\n/**\n * Footer element.\n */\nconst MediaLibraryFooter = ( { settings } ) => {\n\tconst { requestMedia } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\tconst {\n\t\tuser: {\n\t\t\tcapabilities,\n\t\t},\n\t\tpagination,\n\t\tmediaCount,\n\t\tisQuerying,\n\t} = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\n\t\treturn {\n\t\t\tuser: store.getLoggedInUser(),\n\t\t\tpagination: store.getPagination(),\n\t\t\tmediaCount: store.countMedia(),\n\t\t\tisQuerying: store.isQuerying(),\n\t\t};\n\t}, [] );\n\tconst canPaginate = !! settings.isAdminScreen && !! capabilities && -1 !== capabilities.indexOf( 'bp_moderate' );\n\tconst totalUserLibraries = parseInt( pagination.membersDisplayedAmount, 10 );\n\n\tconst onLoadMore = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst { membersPage } = pagination;\n\n\t\treturn requestMedia( { page: membersPage + 1 } );\n\t}\n\n\tif ( ! canPaginate || ! pagination.membersDisplayedAmount ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t
    \n\t\t\t{\n\t\t\t\ttrue === isQuerying && (\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}\n\t\t\t

    \n\t\t\t\t{\n\t\t\t\t\t1 !== totalUserLibraries ? sprintf(\n\t\t\t\t\t\t/* translators: 1: the list of libraries per-page. 2: the total number of libraries */\n\t\t\t\t\t\t__( 'Showing %1$s of %2$s media libraries', 'bp-attachments' ),\n\t\t\t\t\t\tmediaCount,\n\t\t\t\t\t\ttotalUserLibraries\n\t\t\t\t\t) : __( 'Showing one media library', 'bp-attachments' )\n\t\t\t\t}\n\t\t\t

    \n\t\t\t{\n\t\t\t\tmediaCount !== totalUserLibraries && ! isQuerying && (\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}\n\t\t
    \n\t);\n};\n\nexport default MediaLibraryFooter;\n","/**\n * WordPress dependencies\n */\nconst {\n\tdomReady,\n\telement: {\n\t\tcreateElement,\n\t\trender,\n\t\tFragment,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tdata: {\n\t\tuseSelect,\n\t\tuseDispatch,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport { BP_ATTACHMENTS_STORE_KEY } from './store';\nimport MediaLibraryHeader from './elements/header';\nimport MediaLibraryUploader from './elements/uploader';\nimport MediaLibraryDirectoryCreator from './elements/directory-creator';\nimport MediaLibraryToolbar from './elements/toolbar';\nimport MediaLibraryMain from './elements/main';\nimport MediaLibraryFooter from './elements/footer';\n\nconst MediaLibrary = ( { settings } ) => {\n\tconst { isGrid, globalSettings } = useSelect( ( select ) => {\n\t\tconst store = select( BP_ATTACHMENTS_STORE_KEY );\n\t\treturn {\n\t\t\tisGrid: store.isGridDisplayMode(),\n\t\t\tglobalSettings: store.getSettings(),\n\t\t};\n\t}, [] );\n\n\tif ( ! Object.keys( globalSettings ).length ) {\n\t\tconst { setSettings } = useDispatch( BP_ATTACHMENTS_STORE_KEY );\n\t\tsetSettings( settings );\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t);\n};\n\ndomReady( function() {\n\tconst settings = window.bpAttachmentsMediaLibrarySettings || {};\n\trender( , document.querySelector( '#bp-media-library' ) );\n} );\n"],"names":["STORE_KEY","i18n","__","wp","filter","lodash","getDirectoryAncestors","tree","parentId","parents","id","forEach","parent","grandParents","bytesToSize","bytes","sizes","i","parseInt","Math","floor","log","toFixed","trim","groupBy","indexOf","find","defaultTo","getSettings","state","settings","getRequestsContext","isAdminScreen","isGridDisplayMode","isGrid","getLoggedInUser","user","getDisplayedUserId","displayedUserId","getFormState","formState","isUploading","uploading","isQuerying","querying","uploadEnded","ended","getUploads","uploads","getErrors","errors","getMedia","files","countMedia","length","getCurrentDirectory","currentDirectory","getCurrentDirectoryObject","defaultValue","readonly","getTree","groupedTree","currentChildrenIds","map","child","childId","currentAncestors","ancestor","Object","keys","treeIndex","fillWithChildren","items","item","children","getFlatTree","isSelectable","selectedMedia","getRelativePath","relativePath","getDestinationData","object","destinationData","split","visibility","getPagination","pagination","TYPES","SET_SETTINGS","GET_LOGGED_IN_USER","SET_DISPLAYED_USER_ID","GET_MEDIA","ADD_MEDIUM","FILL_TREE","PURGE_TREE","REMOVE_MEDIUM","FETCH_FROM_API","GET_FROM_API","CREATE_FROM_API","UPDATE_FROM_API","DELETE_FROM_API","UPLOAD_START","UPLOAD_END","RESET_UPLOADS","ADD_ERROR","REMOVE_ERROR","TOGGLE_SELECTABLE","TOGGLE_MEDIA_SELECTION","SWITCH_DISPLAY_MODE","UPDATE_FORM_STATE","SET_QUERY_STATUS","uniqueId","hasIn","trimEnd","data","dispatch","select","url","addQueryArgs","setSettings","type","types","fetchFromAPI","path","parse","getFromAPI","response","createFromAPI","updateFromAPI","deleteFromAPI","totalBytes","switchDisplayMode","setDisplayedUserId","userId","updateFormState","params","setItemTree","directory","slug","name","title","media_type","initTree","directories","mime_type","itemTree","addItemTree","removeItemTree","itemId","toggleSelectable","toggleMediaSelection","ids","isSelected","addMedium","file","addMediumError","error","createMedium","upload","store","formData","FormData","append","uploadRelativePath","replace","message","uploaded","createDirectory","directoryName","directoryType","createDirRelativePath","currentDir","updateMedium","medium","update","relative_path","description","selected","updated","parseResponseMedia","async","arguments","undefined","json","then","membersPage","requestMedia","args","relativePathHeader","context","user_id","headers","get","membersDisplayedAmount","totalMembersPage","page","removeMedium","deleteMedium","deleted","previous","removeMediumError","errorID","getLoggedInUserAction","window","bpAttachmentsMediaLibrarySettings","_requestContext","getMediaAction","reject","DEFAULT_STATE","$101f7048d1a3a5c4$export$2e2bcd8739ae039","action","media","u","apiFetch","controls","_ref","_ref2","_ref3","method","body","_ref4","_ref5","total_bytes","registerStore","reducer","actions","selectors","resolvers","BP_ATTACHMENTS_STORE_KEY","components","Popover","useDispatch","useSelect","element","createElement","Fragment","useState","$fcd8ebc78e2f45bd$export$2e2bcd8739ae039","currentDirectoryObject","isOpen","setOpen","toggleClass","dashiconClass","canUpload","allowedExtByMediaList","hrClass","pageTitle","capabilities","showUploadForm","e","preventDefault","parentDirectory","dirOptions","text","push","dirList","dirOption","$fcd8ebc78e2f45bd$var$createElement","key","href","className","onClick","showCreateDirForm","$fcd8ebc78e2f45bd$var$Fragment","$fcd8ebc78e2f45bd$var$Popover","noArrow","onFocusOutside","DropZone","FormFileUpload","sprintf","$9677e9ae62a97894$export$2e2bcd8739ae039","maxUploadFileSize","allowedExtTypes","resetFormState","uploadMedia","currentTarget","numMedia","size","allowedExts","$9677e9ae62a97894$var$createElement","$9677e9ae62a97894$var$DropZone","label","onFilesDrop","closeForm","$9677e9ae62a97894$var$FormFileUpload","onChange","multiple","accept","Button","TextControl","$bdff20d4da09a7d7$export$2e2bcd8739ae039","setDirectoryName","nameLabel","buttonLabel","$bdff20d4da09a7d7$var$createElement","$bdff20d4da09a7d7$var$TextControl","value","$bdff20d4da09a7d7$var$Button","variant","makeDirectory","ExternalLink","TextareaControl","$8bf00b4ce561239f$export$2e2bcd8739ae039","errorCallback","icon","links","view","download","src","editedMedium","editMedium","isDisabled","hasNoPreview","isDirectory","contentClasses","$8bf00b4ce561239f$var$createElement","$8bf00b4ce561239f$var$ExternalLink","join","preload","muted","$8bf00b4ce561239f$var$TextControl","help","$8bf00b4ce561239f$var$TextareaControl","$8bf00b4ce561239f$var$Button","disabled","reverse","Modal","TreeSelect","hooks","applyFilters","$b3153ca487c736b9$export$2e2bcd8739ae039","gridDisplay","flatTree","setPage","toggleModal","canSelect","hasSelectedMedia","hasOneSelectedMedia","canModerate","switchMode","$b3153ca487c736b9$var$createElement","$b3153ca487c736b9$var$Button","event","toggle","onToggleSectable","numSelectedMedia","onDeleteSelected","$b3153ca487c736b9$var$Modal","onRequestClose","$b3153ca487c736b9$var$TreeSelect","noOptionLabel","updateDisplayedUserId","directoryItem","chunks","memberIndex","splice","changeDirectory","selectedId","template","$d68106db0b2679ed$export$2e2bcd8739ae039","tmpl","document","querySelector","innerHTML","evaluate","interpolate","escape","variable","$25915412e7fc4248$export$2e2bcd8739ae039","props","Template","setTemplate","selectMedia","$25915412e7fc4248$var$createElement","$25915412e7fc4248$var$Fragment","dangerouslySetInnerHTML","__html","role","mimeType","onMediaClick","$25915412e7fc4248$var$Modal","Animate","Dashicon","Notice","$bae870346126130f$export$2e2bcd8739ae039","errorNotices","$bae870346126130f$var$createElement","$bae870346126130f$var$Notice","status","onRemove","onRemoveError","isDismissible","$bae870346126130f$var$Dashicon","loadingNotice","numberUploads","uploadingMedia","$bae870346126130f$var$Animate","$1e56901890e67653$export$2e2bcd8739ae039","modeClass","mediaItems","$1e56901890e67653$var$createElement","mediaType","vignette","orientation","Spinner","$f1e2296ec28b8041$export$2e2bcd8739ae039","mediaCount","canPaginate","totalUserLibraries","$f1e2296ec28b8041$var$createElement","$f1e2296ec28b8041$var$Spinner","$f1e2296ec28b8041$var$Button","onLoadMore","domReady","render","MediaLibrary","globalSettings","$85929bbc1a3f4ac8$var$createElement","$85929bbc1a3f4ac8$var$Fragment","$85929bbc1a3f4ac8$var$MediaLibrary"],"version":3,"file":"index.js.map"} \ No newline at end of file diff --git a/languages/bp-attachments.pot b/languages/bp-attachments.pot index d4ea837..8f6b389 100644 --- a/languages/bp-attachments.pot +++ b/languages/bp-attachments.pot @@ -1,5 +1,5 @@ -# Copyright (C) 2021 The BuddyPress Community -# This file is distributed under the same license as the BP Attachments plugin. +# Copyright (C) 2023 The BuddyPress Community +# This file is distributed under the GPL-2.0+. msgid "" msgstr "" "Project-Id-Version: BP Attachments 1.0.0-alpha\n" @@ -9,13 +9,12 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2021-02-28T14:31:49+01:00\n" +"POT-Creation-Date: 2023-01-25T20:09:57+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.4.0\n" +"X-Generator: WP-CLI 2.5.0\n" "X-Domain: bp-attachments\n" #. Plugin Name of the plugin -#: bp-attachments/js/dist/block/index.js:5 msgid "BP Attachments" msgstr "" @@ -24,7 +23,7 @@ msgid "https://github.com/buddypress/bp-attachments" msgstr "" #. Description of the plugin -msgid "BP Attachments is a BuddyPress component to manage user media." +msgid "BP Attachments is a BuddyPress component to manage your community media." msgstr "" #. Author of the plugin @@ -35,332 +34,1272 @@ msgstr "" msgid "http://buddypress.org/community/members/" msgstr "" -#: bp-attachments/bp-attachments-admin.php:82 -#: bp-attachments/bp-attachments-admin.php:152 -msgid "BuddyPress Media Library" +#: bp-attachments/bp-attachments-activity.php:87 +msgid "Attach Media" msgstr "" -#: bp-attachments/bp-attachments-admin.php:83 -msgid "BuddyPress Library" +#: bp-attachments/bp-attachments-admin.php:53 +msgid "Community Library" msgstr "" -#: bp-attachments/bp-attachments-functions.php:107 -msgctxt "public status slug" +#: bp-attachments/bp-attachments-admin.php:55 +msgid "Community Libraries" +msgstr "" + +#: bp-attachments/bp-attachments-blocks.php:49 +#: bp-attachments/classes/class-bp-attachments-component.php:183 +#: src/blocks/common/components/attachment-placeholder.js:120 +msgid "Community Media" +msgstr "" + +#: bp-attachments/bp-attachments-blocks.php:280 +#: src/blocks/file-attachment/js/edit.js:80 +msgid "Download" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:263 +#: bp-attachments/classes/class-bp-attachments-component.php:38 +msgid "Attachments" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:264 +msgid "Empower your community with user generated media." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:313 +msgid "The server’s document root is missing." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:322 +msgid "The private root directory is missing." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:330 +msgid "The private root directory is not writeable." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:357 +msgid "The private root directory is not set the right way." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:438 +msgctxt "public visibility slug" msgid "public" msgstr "" -#: bp-attachments/bp-attachments-functions.php:108 -msgctxt "private status slug" +#: bp-attachments/bp-attachments-functions.php:439 +msgctxt "private visibility slug" msgid "private" msgstr "" -#: bp-attachments/bp-attachments-functions.php:121 +#: bp-attachments/bp-attachments-functions.php:461 msgctxt "member object slug" msgid "members" msgstr "" -#: bp-attachments/bp-attachments-functions.php:122 -msgctxt "group object slug" -msgid "groups" -msgstr "" - -#: bp-attachments/bp-attachments-functions.php:135 +#: bp-attachments/bp-attachments-functions.php:475 msgctxt "download action slug" msgid "download" msgstr "" -#: bp-attachments/bp-attachments-functions.php:136 +#: bp-attachments/bp-attachments-functions.php:476 msgctxt "view action slug" msgid "view" msgstr "" -#: bp-attachments/bp-attachments-functions.php:396 +#: bp-attachments/bp-attachments-functions.php:477 +msgctxt "embed action slug" +msgid "embed" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1016 +msgid "Public" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1020 +msgid "This Public directory and its children are visible to everyone." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1029 +msgid "This Private directory and its children are only visible to you. Files and folders within this private directory can be shared with the users you chose." +msgstr "" + +#. Translators: %s is the user's username +#: bp-attachments/bp-attachments-functions.php:1033 +msgid "This Private directory and its children are only visible to %s. Files and folders within this private directory can be shared with the users they chose." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1041 msgid "Private" msgstr "" -#: bp-attachments/bp-attachments-functions.php:400 -msgid "This Private directory and its children are only visible to logged in users." +#: bp-attachments/bp-attachments-functions.php:1113 +#: bp-attachments/classes/class-bp-attachments-component.php:329 +msgid "My Media" msgstr "" -#: bp-attachments/bp-attachments-functions.php:409 -msgid "Public" +#: bp-attachments/bp-attachments-functions.php:1117 +msgid "This directory contains all your personal media." msgstr "" -#: bp-attachments/bp-attachments-functions.php:413 -msgid "This Public directory and its children are visible to everyone." +#. Translators: %s is the username +#: bp-attachments/bp-attachments-functions.php:1177 +msgid "%s’s Media" +msgstr "" + +#. Translators: %s is the username +#: bp-attachments/bp-attachments-functions.php:1185 +msgid "This directory contains all %s’s personal media." +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1270 +msgid "Image" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1271 +msgid "Movie" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1272 +msgid "Sound" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1273 +msgid "Document" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1274 +msgid "Spreadsheet" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1275 +msgid "Presentation" +msgstr "" + +#: bp-attachments/bp-attachments-functions.php:1276 +msgid "Text" msgstr "" -#: bp-attachments/bp-attachments-functions.php:467 +#: bp-attachments/bp-attachments-functions.php:1277 +msgid "Archive" +msgstr "" + +#. Translators: %s is the file size in kilobytes +#: bp-attachments/bp-attachments-functions.php:1497 +msgid "%s KB" +msgstr "" + +#. Translators: %s is the file size in gigabytes +#: bp-attachments/bp-attachments-functions.php:1510 +msgid "%s GB" +msgstr "" + +#. Translators: %s is the file size in megabytes +#: bp-attachments/bp-attachments-functions.php:1514 +msgid "%s MB" +msgstr "" + +#: bp-attachments/bp-attachments-groups.php:29 +msgctxt "group object slug" +msgid "groups" +msgstr "" + +#: bp-attachments/bp-attachments-groups.php:163 msgid "This directory contains the media directories attached to this group" msgstr "" -#: bp-attachments/bp-attachments-functions.php:485 -msgid "My Groups" +#: bp-attachments/bp-attachments-groups.php:184 +msgid "My Groups Media" msgstr "" -#: bp-attachments/bp-attachments-functions.php:490 +#: bp-attachments/bp-attachments-groups.php:189 msgid "This directory contains the media directories of the groups you are a member of." msgstr "" -#: bp-attachments/bp-attachments-functions.php:499 -msgid "My Media" +#: bp-attachments/bp-attachments-profile-images.php:404 +msgid "Member Types" msgstr "" -#: bp-attachments/bp-attachments-functions.php:503 -msgid "This directory contains all your personal media." +#: bp-attachments/bp-attachments-profile-images.php:405 +msgid "Member Type" msgstr "" -#: bp-attachments/classes/class-bp-attachments-component.php:28 -msgid "Attachments" +#. translators: 1. is The private root directory absolute path. 2. is the uploads relative path. +#: bp-attachments/bp-attachments-settings.php:40 +msgid "The %1$s directory needs to share the same user group than the %2$s one." +msgstr "" + +#. translators: 1. The private root directory absolute path. 2. The server's user group +#: bp-attachments/bp-attachments-settings.php:50 +msgid "The %1$s directory needs to have \"%2$s\" as its user group." +msgstr "" + +#. translators: 1. is The private root directory absolute path. 2. is the uploads relative path. +#: bp-attachments/bp-attachments-settings.php:61 +msgid "The %s directory needs to be owned by the same user than the WordPress uploads one." +msgstr "" + +#. translators: 1. The private root directory absolute path. 2. The server's user name +#: bp-attachments/bp-attachments-settings.php:71 +msgid "The %1$s directory needs be owned by \"%2$s\"." +msgstr "" + +#. translators: 1. The private root directory absolute path. 2. is the uploads relative path. 3. The WP uploads directory file permissions. +#: bp-attachments/bp-attachments-settings.php:82 +msgid "The %1$s directory needs to share the same permissions than the WordPress %2$s one: %3$s." +msgstr "" + +#. translators: %s is The private root directory absolute path +#: bp-attachments/bp-attachments-settings.php:98 +msgid "Please make sure the %s exists and is writeable for the server’s user." +msgstr "" + +#. Translators: %s is the category name of the listed mime types. +#: bp-attachments/bp-attachments-settings.php:159 +msgid "Select/Unselect all %s mime types" +msgstr "" + +#: bp-attachments/bp-attachments-settings.php:236 +msgid "BP Attachments settings to store the allowed media types." +msgstr "" + +#: bp-attachments/bp-attachments-settings.php:248 +msgid "BP Attachments settings to let the admin enable private uploads." +msgstr "" + +#: bp-attachments/bp-attachments-settings.php:264 +msgid "Allowed media types" +msgstr "" + +#: bp-attachments/bp-attachments-settings.php:272 +msgid "Private media" +msgstr "" + +#. translators: %s is the displayed User full name +#: bp-attachments/bp-attachments-templates.php:227 +#: bp-attachments/classes/class-bp-attachments-component.php:342 +msgid "Profile picture of %s" +msgstr "" + +#. translators: %s is the user link. +#: bp-attachments/bp-attachments-templates.php:355 +msgid "%s shared a media." +msgstr "" + +#. translators: %s is the link to download the media +#: bp-attachments/bp-attachments-templates.php:603 +msgid "If your browser does not take in charge this media format. Please %s to play it from your computer." +msgstr "" + +#: bp-attachments/bp-attachments-templates.php:607 +msgid "download it" +msgstr "" + +#: bp-attachments/bp-attachments-tracking.php:485 +msgid "Images" +msgstr "" + +#: bp-attachments/bp-attachments-tracking.php:486 +msgid "Movies" +msgstr "" + +#: bp-attachments/bp-attachments-tracking.php:487 +msgid "Sounds" +msgstr "" + +#: bp-attachments/bp-attachments-tracking.php:501 +msgid "Other files" +msgstr "" + +#: bp-attachments/bp-attachments-tracking.php:522 +msgid "Attachments Directory menu" msgstr "" -#: bp-attachments/classes/class-bp-attachments-component.php:127 -msgid "User Media" +#: bp-attachments/bp-attachments-tracking.php:524 +msgid "All Media" msgstr "" -#: bp-attachments/classes/class-bp-attachments-component.php:169 -#: bp-attachments/classes/class-bp-attachments-component.php:230 +#: bp-attachments/bp-attachments-users.php:27 +#: bp-attachments/bp-attachments-users.php:48 +msgid "Total space in bytes used by user’s files" +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-component.php:235 +#: bp-attachments/classes/class-bp-attachments-component.php:296 msgid "Media" msgstr "" -#: bp-attachments/classes/class-bp-attachments-component.php:192 -#: bp-attachments/classes/class-bp-attachments-component.php:242 +#: bp-attachments/classes/class-bp-attachments-component.php:258 +#: bp-attachments/classes/class-bp-attachments-component.php:308 msgid "Personal" msgstr "" -#. translators: %s is the Displayed User full name -#: bp-attachments/classes/class-bp-attachments-component.php:276 -msgid "Profile picture of %s" +#: bp-attachments/classes/class-bp-attachments-component.php:742 +msgctxt "page label" +msgid "BP Attachments Page" msgstr "" #. translators: %s is for the max upload file size. -#: bp-attachments/classes/class-bp-attachments-media.php:49 +#: bp-attachments/classes/class-bp-attachments-media.php:45 msgid "That media is too big. Please upload one smaller than %s" msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:52 -msgid "This file type is not allowed. Please use another one." +#: bp-attachments/classes/class-bp-attachments-media.php:48 +msgid "This file type is not allowed into this directory. Please use another one." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:53 +#: bp-attachments/classes/class-bp-attachments-media.php:49 msgid "A file with this name already exists but the revisions directory is missing." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:54 +#: bp-attachments/classes/class-bp-attachments-media.php:50 msgid "A file with this name already exists but the data describing this existing file are missing." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:55 +#: bp-attachments/classes/class-bp-attachments-media.php:51 msgid "Unexpected error, please contact the administrator of the site." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:56 +#: bp-attachments/classes/class-bp-attachments-media.php:52 msgid "The destination directory is missing." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:57 -msgid "Unknown group. Please try again" +#: bp-attachments/classes/class-bp-attachments-media.php:53 +msgid "Unknown user, item or destination directory. Please try again." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:58 -msgid "Unknown user. Please try again" +#: bp-attachments/classes/class-bp-attachments-media.php:54 +msgid "Private uploads are disabled. Try uploading your file publicly instead." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:342 +#: bp-attachments/classes/class-bp-attachments-media.php:296 msgid "The name of your directory or its type are missing or not supported." msgstr "" -#: bp-attachments/classes/class-bp-attachments-media.php:364 +#: bp-attachments/classes/class-bp-attachments-media.php:322 +msgid "Creating sub-directories into the current directory is not allowed." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-media.php:332 msgid "There is already a directory with this name into the requested destination." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:54 -msgid "Whether to upload a media or create a directory." +#: bp-attachments/classes/class-bp-attachments-oembed-extension.php:81 +msgid "Embedded Community Media" +msgstr "" + +#. translators: 1. The medium title. 2. The user display name. 3. The user mention name between parenthesis. 4. The date. +#: bp-attachments/classes/class-bp-attachments-oembed-extension.php:264 +msgid "%1$s is shared by %2$s%3$s since %4$s." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:56 +msgid "The object the profile image is attached to." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:66 +msgid "A unique numeric ID for the Object." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:71 +msgid "The captured image area to use as the object’s profile image." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:74 +#. translators: %s: transport method name +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:94 +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:113 +msgid "'%s' Transport Method not implemented." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:132 +msgid "Sorry, member avatar upload is disabled." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:140 +msgid "Invalid member ID." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:157 +msgid "Sorry, you are not allowed to change this member’s profile image." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:198 +msgid "Sorry, you need an image file to upload." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:220 +msgid "Sorry, we could not create your profile image." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:289 +msgid "Full size of the image file." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-profile-image-rest-controller.php:296 +msgid "Thumb size of the image file." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:63 +msgid "Whether to upload a medium or create a directory." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:72 +msgid "The object the medium is uploaded for." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:81 +msgid "The object single item the medium is uploaded for." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:89 +msgid "The object type the medium is attached to." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:97 +msgid "The object id the medium is attached to." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:105 +msgid "The total bytes sent during an upload process." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:124 msgid "An alphanumeric ID for the BP Medium object." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:78 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:128 msgid "Relative path to the BP Medium object." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:113 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:133 +msgid "The total bytes to remove after a delete process." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:170 msgid "Sorry, you are not allowed to request media." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:244 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:306 +msgid "The page number requested is larger than the number of pages available." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:371 msgid "Sorry, you are not allowed to create media." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:284 -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:320 -msgid "No data supplied." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:415 +msgid "No files were provided." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:444 +msgid "You cannot upload files into the required destination" msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:401 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:499 +msgid "You cannot create directories into the required destination" +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:509 +msgid "Some information are missing to be able to create the directory." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:536 +msgid "This action is not supported by the BP Attachments plugin." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:636 +msgid "Sorry, you are not allowed to edit media." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:676 +msgid "Sorry, we were not able to edit the media." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:726 msgid "Sorry, you are not allowed to delete media." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:471 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:759 msgid "Sorry, we were not able to delete the media." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:615 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:954 msgid "Relative path to the directory to only list its content." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:621 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:960 msgid "Limit result set to items created by a specific user (ID)." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:637 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:976 msgid "Limit result set to items attached to active BuddyPress component." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:672 -msgid "A unique alphanumeric ID for the media." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1011 +msgid "A unique alphanumeric ID for the medium." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:680 -msgid "The name of the media." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1019 +msgid "A unique numeric ID for the user owning the medium." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:687 -msgid "The pretty name of the media." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1027 +msgid "The name of the BuddyPress component the medium is attached to." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:694 -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:701 -msgid "The description of the media." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1035 +msgid "The name of the medium." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:709 -msgid "Whether the media is a directory or a file." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1042 +msgid "The pretty name of the medium." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:718 -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:726 -msgid "Timestamp of the last time the media was modified." +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1049 +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1057 +msgid "The description of the medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1065 +msgid "Whether the medium is a directory or a file." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1074 +msgid "Timestamp of the last time the medium was modified." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1082 +msgid "Size in kilobytes for the medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1090 +msgid "URL of the image to use as a vignette for the medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1099 +msgid "URL of the image to use as an icon for the medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1108 +msgid "Orientation for the image medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1117 +msgid "Extension of the medium file." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1125 +msgid "Human readable medium type" +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1133 +msgid "Whether the medium is private or public" +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1142 +msgid "Whether the medium (directory) is readonly or not" +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1151 +msgid "The medium links." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1159 +msgid "The embed URL for the medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1166 +msgid "The source URL to the public medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1173 +msgid "The view permalink to the medium." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-rest-controller.php:1182 +msgid "List of objects the medium is attached to" +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:228 +msgid "A unique numeric ID for the tracked media." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:234 +msgid "The active BuddyPress component the tracked media relates to." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:243 +msgid "The ID for the author of the tracked media." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:249 +msgid "The permalink to the tracked media on the site." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:255 +msgid "The type of the tracked media." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:264 +msgid "Allowed HTML content for the tracked media." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:734 -msgid "Url of the image to use as a vignette." +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:272 +msgid "Content for the tracked media, as it exists in the database." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:743 -msgid "Orientation for the vignette." +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:277 +msgid "HTML content for the tracked media, transformed for display." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:752 -msgid "Extension of the file." +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:286 +msgid "The date the activity was published, in the site's timezone." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:760 -msgid "Human readable media type" +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:293 +msgid "The date the activity was published, as GMT." msgstr "" -#: bp-attachments/classes/class-bp-attachments-rest-controller.php:768 -msgid "The path to the media" +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:300 +msgid "Whether the media is privately or publicly tracked." +msgstr "" + +#. translators: 1: Full avatar width in pixels. 2: Full avatar height in pixels +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:313 +msgid "Avatar URL with full image size (%1$d x %2$d pixels)." +msgstr "" + +#. translators: 1: Thumb avatar width in pixels. 2: Thumb avatar height in pixels +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:321 +msgid "Avatar URL with thumb image size (%1$d x %2$d pixels)." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:328 +msgid "Avatar URLs for the author of the activity." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:363 +msgid "Order by attribute." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:372 +msgid "Sort attribute: ascending or descending." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:381 +msgid "Limit result set to items with a specific active BuddyPress component." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:390 +msgid "Limit result set to items with a specific media type." +msgstr "" + +#: bp-attachments/classes/class-bp-attachments-tracking-rest-controller.php:399 +msgid "Whether to fetch publicly or privately tracked media." +msgstr "" + +#: class-bp-attachments.php:172 +msgctxt "BuddyPress WP plugin directory URL" +msgid "https://wordpress.org/plugins/buddypress" +msgstr "" + +#. translators: 1. is the link to the BuddyPress plugin on the WordPress.org plugin directory. +#: class-bp-attachments.php:178 +msgid "BP Attachments requires the %1$s plugin to be active. Please deactivate BP Attachments, activate %1$s and only then, reactivate BP Attachments." +msgstr "" + +#. translators: %s is the WP login link +#: templates/attachments/single/download.php:23 +msgid "You need to %s to be able to download this media." +msgstr "" + +#: templates/attachments/single/download.php:27 +#: templates/attachments/single/view.php:52 +msgid "log in" +msgstr "" + +#: templates/attachments/single/download.php:36 +#: templates/attachments/single/view.php:61 +msgid "This media is private and its owner has not shared it with you." +msgstr "" + +#: templates/attachments/single/parts/single-audio.php:19 +#: templates/attachments/single/parts/single-image.php:21 +#: templates/attachments/single/parts/single-video.php:19 +#: templates/attachments/single/parts/single.php:23 +msgid "Lastly edited on:" +msgstr "" + +#: templates/attachments/single/parts/single-audio.php:21 +msgid "Audio type:" +msgstr "" + +#: templates/attachments/single/parts/single-audio.php:23 +msgid "Audio size:" +msgstr "" + +#: templates/attachments/single/parts/single-image.php:23 +msgid "Image type:" +msgstr "" + +#: templates/attachments/single/parts/single-image.php:25 +msgid "Image size:" +msgstr "" + +#: templates/attachments/single/parts/single-video.php:21 +msgid "Video type:" +msgstr "" + +#: templates/attachments/single/parts/single-video.php:23 +msgid "Video size:" +msgstr "" + +#: templates/attachments/single/parts/single.php:25 +#: templates/common/js-templates/attachments/media-preview.php:34 +msgid "File type:" +msgstr "" + +#: templates/attachments/single/parts/single.php:27 +#: templates/common/js-templates/attachments/media-item.php:65 +#: templates/common/js-templates/attachments/media-preview.php:36 +msgid "File size:" +msgstr "" + +#: templates/attachments/single/view.php:30 +msgid "Shared by: " +msgstr "" + +#. translators: %s is the WP login link +#: templates/attachments/single/view.php:48 +msgid "You need to %s to be able to view this media." msgstr "" #: templates/common/js-templates/attachments/media-item.php:33 +#: templates/common/js-templates/attachments/media-item.php:71 msgid "Deselect" msgstr "" -#: bp-attachments/js/dist/block/index.js:7 -msgid "BuddyPress Attachments Media." +#: templates/common/js-templates/attachments/media-item.php:63 +msgid "Disk usage:" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1479 -msgid "Upload new" +#: templates/common/js-templates/attachments/media-preview.php:16 +#: templates/common/js-templates/attachments/media-preview.php:17 +msgid "Remove media" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1483 -msgid "More actions" +#: templates/common/js-templates/attachments/media-preview.php:32 +msgid "File name:" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1489 -msgid "Add new directory" +#: templates/members/single/profile/edit-avatar.php:15 +msgid "Change Profile Photo" +msgstr "" + +#. Translators: %s is used to output the link to the Gravatar site +#: templates/members/single/profile/edit-avatar.php:27 +msgid "Your profile photo will be used on your profile and throughout the site. If there is a %s associated with your account email we will use that, or you can upload an image from your computer." msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1552 +#. Translators: Url to the Gravatar site, you can use the one for your country eg: https://fr.gravatar.com for French translation +#: templates/members/single/profile/edit-avatar.php:29 +#: templates/members/single/profile/edit-avatar.php:45 +msgid "https://gravatar.com" +msgstr "" + +#. Translators: %s is used to output the link to the Gravatar site +#: templates/members/single/profile/edit-avatar.php:43 +msgid "Your profile photo will be used on your profile and throughout the site. To change your profile photo, create an account with %s using the same email address as you used to register with this site." +msgstr "" + +#: templates/members/single/profile/edit-cover-image.php:15 +msgid "Change Cover Image" +msgstr "" + +#: templates/members/single/profile/edit-cover-image.php:21 +msgid "Your Cover Image will be used to customize the header of your profile." +msgstr "" + +#: src/avatar-editor/elements/cropper.js:60 +msgid "Zoom" +msgstr "" + +#: src/avatar-editor/elements/cropper.js:67 +msgid "Save profile photo" +msgstr "" + +#: src/avatar-editor/elements/uploader.js:26 +msgid "Drop your image here." +msgstr "" + +#: src/avatar-editor/elements/uploader.js:31 +msgid "Drop an image here" +msgstr "" + +#: src/avatar-editor/elements/uploader.js:32 +#: src/media-library/elements/uploader.js:98 +#: bp-attachments/js/media-library/index.js:1647 +msgid "or" +msgstr "" + +#: src/avatar-editor/elements/uploader.js:39 +msgid "Select an image" +msgstr "" + +#: src/avatar-editor/index.js:126 +msgid "Profile image successfully saved." +msgstr "" + +#: src/avatar-editor/index.js:132 +msgid "Unknow error. Please try again." +msgstr "" + +#: src/blocks/audio-attachment/js/edit.js:36 +msgid "Community Audio" +msgstr "" + +#: src/blocks/audio-attachment/js/edit.js:55 +#: src/blocks/video-attachment/js/edit.js:55 +msgid "If your browser does not take in charge this media format. Please download it to play it from your computer." +msgstr "" + +#: src/blocks/common/components/attachment-placeholder.js:134 +msgid "Select a file" +msgstr "" + +#: src/blocks/file-attachment/js/edit.js:47 +msgid "Community File" +msgstr "" + +#: src/blocks/file-attachment/js/edit.js:72 +msgid "Write file name…" +msgstr "" + +#: src/blocks/image-attachment/js/edit.js:36 +msgid "Community Image" +msgstr "" + +#: src/blocks/video-attachment/js/edit.js:36 +msgid "Community Video" +msgstr "" + +#: src/media-library/elements/directory-creator.js:65 +#: bp-attachments/js/media-library/index.js:1730 msgid "Create a new directory" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1554 +#: src/media-library/elements/directory-creator.js:66 +#: bp-attachments/js/media-library/index.js:1731 msgid "Type a name for your directory" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1559 -msgid "Select a type for your directory" +#: src/media-library/elements/directory-creator.js:67 +#: bp-attachments/js/media-library/index.js:1732 +msgid "Save directory" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1562 -msgid "File directory" +#: src/media-library/elements/directory-creator.js:70 +#: bp-attachments/js/media-library/index.js:1735 +msgid "Create a new photo album" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1563 -msgid "Photo Album" +#: src/media-library/elements/directory-creator.js:71 +#: bp-attachments/js/media-library/index.js:1736 +msgid "Type a name for your photo album" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1564 -msgid "Audio Playlist" +#: src/media-library/elements/directory-creator.js:72 +#: bp-attachments/js/media-library/index.js:1737 +msgid "Save photo album" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1565 -msgid "Video Playlist" +#: src/media-library/elements/directory-creator.js:74 +#: bp-attachments/js/media-library/index.js:1739 +msgid "Create a new audio playlist" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1570 -msgid "Save directory" +#: src/media-library/elements/directory-creator.js:75 +#: bp-attachments/js/media-library/index.js:1740 +msgid "Type a name for your audio playlist" +msgstr "" + +#: src/media-library/elements/directory-creator.js:76 +#: bp-attachments/js/media-library/index.js:1741 +msgid "Save audio playlist" +msgstr "" + +#: src/media-library/elements/directory-creator.js:78 +#: bp-attachments/js/media-library/index.js:1743 +msgid "Create a new video playlist" +msgstr "" + +#: src/media-library/elements/directory-creator.js:79 +#: bp-attachments/js/media-library/index.js:1744 +msgid "Type a name for your video playlist" +msgstr "" + +#: src/media-library/elements/directory-creator.js:80 +#: bp-attachments/js/media-library/index.js:1745 +msgid "Save video playlist" +msgstr "" + +#: src/media-library/elements/directory-creator.js:86 +#: bp-attachments/js/media-library/index.js:1751 +msgid "Close the Create directory form" +msgstr "" + +#: src/media-library/elements/edit-item.js:99 +#: bp-attachments/js/media-library/index.js:1866 +msgid "Open directory page" +msgstr "" + +#: src/media-library/elements/edit-item.js:99 +#: bp-attachments/js/media-library/index.js:1866 +msgid "Open media page" +msgstr "" + +#: src/media-library/elements/edit-item.js:101 +#: bp-attachments/js/media-library/index.js:1868 +msgid "Download media" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1638 +#. translators: %s is the media name +#: src/media-library/elements/edit-item.js:132 +#: bp-attachments/js/media-library/index.js:1896 +msgid "Edit %s" +msgstr "" + +#: src/media-library/elements/edit-item.js:135 +#: bp-attachments/js/media-library/index.js:1897 +msgid "Use the below fields to edit media properties." +msgstr "" + +#: src/media-library/elements/edit-item.js:137 +#: bp-attachments/js/media-library/index.js:1899 +msgid "Title" +msgstr "" + +#: src/media-library/elements/edit-item.js:140 +#: bp-attachments/js/media-library/index.js:1902 +msgid "Change the title of your medium to something more descriptive then its file name." +msgstr "" + +#: src/media-library/elements/edit-item.js:143 +#: bp-attachments/js/media-library/index.js:1905 +msgid "Description" +msgstr "" + +#: src/media-library/elements/edit-item.js:146 +#: bp-attachments/js/media-library/index.js:1908 +msgid "Add or edit the description of your medium to tell your story about it." +msgstr "" + +#. translators: 1: the list of libraries per-page. 2: the total number of libraries +#: src/media-library/elements/footer.js:74 +#: bp-attachments/js/media-library/index.js:2555 +msgid "Showing %1$s of %2$s media libraries" +msgstr "" + +#: src/media-library/elements/footer.js:77 +#: bp-attachments/js/media-library/index.js:2558 +msgid "Showing one media library" +msgstr "" + +#: src/media-library/elements/footer.js:83 +#: bp-attachments/js/media-library/index.js:2564 +msgid "Load more" +msgstr "" + +#: src/media-library/elements/header.js:51 +#: bp-attachments/js/media-library/index.js:1430 +msgid "Community Media Libraries" +msgstr "" + +#: src/media-library/elements/header.js:51 +#: bp-attachments/js/media-library/index.js:1430 +msgid "Community Media Library" +msgstr "" + +#: src/media-library/elements/header.js:83 +#: bp-attachments/js/media-library/index.js:1462 +msgid "Add new directory" +msgstr "" + +#: src/media-library/elements/header.js:93 +#: bp-attachments/js/media-library/index.js:1472 +msgid "Add new photo album" +msgstr "" + +#: src/media-library/elements/header.js:100 +#: bp-attachments/js/media-library/index.js:1479 +msgid "Add new audio playlist" +msgstr "" + +#: src/media-library/elements/header.js:107 +#: bp-attachments/js/media-library/index.js:1486 +msgid "Add new video playlist" +msgstr "" + +#: src/media-library/elements/header.js:135 +#: bp-attachments/js/media-library/index.js:1514 +msgid "Library" +msgstr "" + +#: src/media-library/elements/header.js:143 +#: bp-attachments/js/media-library/index.js:1522 +msgid "Add new" +msgstr "" + +#: src/media-library/elements/header.js:147 +#: bp-attachments/js/media-library/index.js:1526 +msgid "More actions" +msgstr "" + +#: src/media-library/elements/header.js:153 +#: bp-attachments/js/media-library/index.js:1532 +msgid "Upload media" +msgstr "" + +#: src/media-library/elements/item.js:84 +#: src/media-library/elements/toolbar.js:231 +#: bp-attachments/js/media-library/index.js:2155 +#: bp-attachments/js/media-library/index.js:2279 +msgid "Media details" +msgstr "" + +#: src/media-library/elements/main.js:72 +#: bp-attachments/js/media-library/index.js:2474 +msgid "No community media items found." +msgstr "" + +#. translators: 1: file name. 2: error message. +#: src/media-library/elements/notices.js:61 +#: bp-attachments/js/media-library/index.js:2351 +msgid "« %1$s » wasn‘t added to the media library. %2$s" +msgstr "" + +#: src/media-library/elements/notices.js:76 +#: bp-attachments/js/media-library/index.js:2366 +msgid "Uploading the media, please wait." +msgstr "" + +#. translators: %d: number of media being uploaded. +#: src/media-library/elements/notices.js:79 +#: bp-attachments/js/media-library/index.js:2369 +msgid "Uploading %d media, please wait." +msgstr "" + +#: src/media-library/elements/toolbar.js:207 +#: bp-attachments/js/media-library/index.js:2131 msgid "Display list" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1641 +#: src/media-library/elements/toolbar.js:210 +#: bp-attachments/js/media-library/index.js:2134 msgid "Display grid" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1647 -msgid "Delete selection" +#: src/media-library/elements/toolbar.js:216 +#: bp-attachments/js/media-library/index.js:2140 +msgid "Select" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1651 -msgid "Bulk Select" +#: src/media-library/elements/toolbar.js:216 +#: bp-attachments/js/media-library/index.js:2140 +msgid "Cancel Selection" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1651 -msgid "Cancel" +#: src/media-library/elements/toolbar.js:221 +#: bp-attachments/js/media-library/index.js:2145 +msgid "Edit" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1766 -msgid "Details for: %s" +#: src/media-library/elements/toolbar.js:226 +#: bp-attachments/js/media-library/index.js:2150 +msgid "Delete selection" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:1774 -msgid "@todo Fetch the Media properties." +#: src/media-library/elements/toolbar.js:241 +#: bp-attachments/js/media-library/index.js:2165 +msgid "All members" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:2003 -msgid "Uploaded!" +#: src/media-library/elements/toolbar.js:241 +#: bp-attachments/js/media-library/index.js:2165 +msgid "Home" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:2011 -msgid "Uploading..." +#: src/media-library/elements/uploader.js:89 +#: bp-attachments/js/media-library/index.js:1638 +msgid "Drop your files here." msgstr "" -#: bp-attachments/js/dist/uploader/index.js:2056 +#: src/media-library/elements/uploader.js:94 +#: bp-attachments/js/media-library/index.js:1643 msgid "Close the upload panel" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:2060 -msgid "Drop your files here." +#: src/media-library/elements/uploader.js:97 +#: bp-attachments/js/media-library/index.js:1646 +msgid "Drop files to upload" msgstr "" -#: bp-attachments/js/dist/uploader/index.js:2068 -msgid "Close the Create directory form" +#: src/media-library/elements/uploader.js:105 +#: bp-attachments/js/media-library/index.js:1654 +msgid "Select Files" +msgstr "" + +#. translators: %s is the max size allowed for a media file +#: src/media-library/elements/uploader.js:112 +#: bp-attachments/js/media-library/index.js:1658 +msgid "Maximum upload file size: %s." +msgstr "" + +#: src/media-library/utils/functions.js:28 +#: bp-attachments/js/front-end/activity.js:46 +#: bp-attachments/js/front-end/messages.js:46 +#: bp-attachments/js/media-library/index.js:35 +msgid "Bytes" +msgstr "" + +#: src/media-library/utils/functions.js:29 +#: bp-attachments/js/front-end/activity.js:47 +#: bp-attachments/js/front-end/messages.js:47 +#: bp-attachments/js/media-library/index.js:36 +msgid "KB" +msgstr "" + +#: src/media-library/utils/functions.js:30 +#: bp-attachments/js/front-end/activity.js:48 +#: bp-attachments/js/front-end/messages.js:48 +#: bp-attachments/js/media-library/index.js:37 +msgid "MB" +msgstr "" + +#: src/media-library/utils/functions.js:31 +#: bp-attachments/js/front-end/activity.js:49 +#: bp-attachments/js/front-end/messages.js:49 +#: bp-attachments/js/media-library/index.js:38 +msgid "GB" +msgstr "" + +#: src/media-library/utils/functions.js:32 +#: bp-attachments/js/front-end/activity.js:50 +#: bp-attachments/js/front-end/messages.js:50 +#: bp-attachments/js/media-library/index.js:39 +msgid "TB" +msgstr "" + +#: src/blocks/audio-attachment/block.json +msgctxt "block title" +msgid "Sound" +msgstr "" + +#: src/blocks/audio-attachment/block.json +msgctxt "block description" +msgid "Insert a sound from your personal media library." +msgstr "" + +#: src/blocks/audio-attachment/block.json +#: src/blocks/file-attachment/block.json +#: src/blocks/image-attachment/block.json +#: src/blocks/video-attachment/block.json +msgctxt "block keyword" +msgid "BuddyPress" +msgstr "" + +#: src/blocks/audio-attachment/block.json +#: src/blocks/file-attachment/block.json +#: src/blocks/image-attachment/block.json +#: src/blocks/video-attachment/block.json +msgctxt "block keyword" +msgid "community" +msgstr "" + +#: src/blocks/audio-attachment/block.json +msgctxt "block keyword" +msgid "audio" +msgstr "" + +#: src/blocks/audio-attachment/block.json +msgctxt "block keyword" +msgid "sound" +msgstr "" + +#: src/blocks/audio-attachment/block.json +msgctxt "block keyword" +msgid "music" +msgstr "" + +#: src/blocks/audio-attachment/block.json +#: src/blocks/file-attachment/block.json +#: src/blocks/image-attachment/block.json +#: src/blocks/video-attachment/block.json +msgctxt "block keyword" +msgid "media" +msgstr "" + +#: src/blocks/file-attachment/block.json +msgctxt "block title" +msgid "File" +msgstr "" + +#: src/blocks/file-attachment/block.json +msgctxt "block description" +msgid "Insert a file from your personal media library." +msgstr "" + +#: src/blocks/file-attachment/block.json +msgctxt "block keyword" +msgid "file" +msgstr "" + +#: src/blocks/image-attachment/block.json +msgctxt "block title" +msgid "Picture" +msgstr "" + +#: src/blocks/image-attachment/block.json +msgctxt "block description" +msgid "Insert a picture from your personal media library." +msgstr "" + +#: src/blocks/image-attachment/block.json +msgctxt "block keyword" +msgid "image" +msgstr "" + +#: src/blocks/image-attachment/block.json +msgctxt "block keyword" +msgid "img" +msgstr "" + +#: src/blocks/image-attachment/block.json +msgctxt "block keyword" +msgid "picture" +msgstr "" + +#: src/blocks/image-attachment/block.json +msgctxt "block keyword" +msgid "photo" +msgstr "" + +#: src/blocks/video-attachment/block.json +msgctxt "block title" +msgid "Movie" +msgstr "" + +#: src/blocks/video-attachment/block.json +msgctxt "block description" +msgid "Insert a movie from your personal media library." +msgstr "" + +#: src/blocks/video-attachment/block.json +msgctxt "block keyword" +msgid "video" +msgstr "" + +#: src/blocks/video-attachment/block.json +msgctxt "block keyword" +msgid "movie" msgstr "" diff --git a/src/media-library/elements/edit-item.js b/src/media-library/elements/edit-item.js index b9cfc04..3cf4824 100644 --- a/src/media-library/elements/edit-item.js +++ b/src/media-library/elements/edit-item.js @@ -126,7 +126,12 @@ const EditMediaItem = ( { medium, errorCallback } ) => {
    -

    { sprintf( __( 'Edit %s', 'bp-attachments' ), name ) }

    +

    + { + /* translators: %s is the media name */ + sprintf( __( 'Edit %s', 'bp-attachments' ), name ) + } +

    { __( 'Use the below fields to edit media properties.', 'bp-attachments' ) }

    {

    { 1 !== totalUserLibraries ? sprintf( + /* translators: 1: the list of libraries per-page. 2: the total number of libraries */ __( 'Showing %1$s of %2$s media libraries', 'bp-attachments' ), mediaCount, totalUserLibraries diff --git a/src/media-library/elements/uploader.js b/src/media-library/elements/uploader.js index 741f02b..9a2debe 100644 --- a/src/media-library/elements/uploader.js +++ b/src/media-library/elements/uploader.js @@ -106,7 +106,12 @@ const MediaLibraryUploader = ( { settings } ) => {

    -

    { sprintf( __( 'Maximum upload file size: %s.', 'bp-attachments' ), bytesToSize( maxUploadFileSize ) ) }

    +

    + { + /* translators: %s is the max size allowed for a media file */ + sprintf( __( 'Maximum upload file size: %s.', 'bp-attachments' ), bytesToSize( maxUploadFileSize ) ) + } +

    ); diff --git a/templates/attachments/single/download.php b/templates/attachments/single/download.php index aa7b847..658b5f4 100644 --- a/templates/attachments/single/download.php +++ b/templates/attachments/single/download.php @@ -19,6 +19,7 @@ %2$s', diff --git a/templates/attachments/single/view.php b/templates/attachments/single/view.php index ed5c9c2..87d297a 100644 --- a/templates/attachments/single/view.php +++ b/templates/attachments/single/view.php @@ -44,6 +44,7 @@ %2$s',