Repository URL to install this package:
|
Version:
3.12.17 ▾
|
@filerobot/explorer
/
README.md
|
|---|
@filerobot/explorerThe file Explorer and media gallery plugin of the Filerobot Media Asset Widget.
npm install --save @filerobot/explorer
yarn add @filerobot/explorer
then
import Explorer from '@filerobot/explorer' ... ... ... filerobot.use(Explorer, propertiesObject)
If installed via a CDN link, the plugin is inside the Filerobot global object as Filerobot.Explorer
const Explorer = window.Filerobot.Explorer ... ... ... filerobot.use(Explorer, propertiesObject)
import '@filerobot/core/dist/style.css' import '@filerobot/explorer/dist/style.css'
or via the minified versions
import '@filerobot/core/dist/style.min.css' import '@filerobot/explorer/dist/style.min.css'
The plugin's css file should be imported after the Core's css file for having the styles shown correctly.
The Explorer supports multiple properties to customize the plugin according to your needs. Required attributes are marked with (Required).
configType: object Required.
Default:
{ config: { companyName: 'scaleflex', foldersLimit: 200, filesLimit: 50, rootFolderPath: '/', tagging: {...} // check tagging section } }
The config objects contains the main configuration for the plugin to interact with your Filerobot project:
companyNameType: string.
Default: scaleflex
Your company name, used when sharing assets.
foldersLimitType: number.
Default: 200
Number of folders to be retrieved with folders initial request.
filesLimitType: number.
Default: 50
Number of files to be retrieved with files initial request.
rootFolderPathType: string.
Default: /
Override the root folder path.
taggingType: object.
Default:
tagging: { enabled: false, autoTagging: false, suggestedTagsOnly: false, language: 'en', confidence: 60, limit: 10, provider: 'google', suggestionList: [] }
The options available for tagging
| Property | Type | Default | Description |
|---|---|---|---|
enabled |
boolean |
false |
Enable/disable tags |
autoTagging |
boolean |
false |
Enable/disable auto-tagging |
suggestedTagsOnly |
boolean |
false |
Enable/disable suggested tags only. When it's TRUE, users can only select tags from a pre-defined list. Notice that when suggestedTagsOnly is TRUE, autoTagging will be disabled. |
language |
string |
en |
AutoTagging config that we add in POST process/autoTag request data.meta |
confidence |
number |
60 |
AutoTagging config that we add in POST process/autoTag request data.meta |
limit |
number |
10 |
AutoTagging config that we add in POST process/autoTag request data.meta |
provider |
string |
[] |
AutoTagging config that we add in POST process/autoTag request data.meta |
suggestionList |
object[] |
1 |
Tags suggestions list that is shown under tags field. By default we show primary tags, but when user start typing we filter full suggestionList. Object format: |
{ sid: string, // Short id like: '#tg1885f' names: { en: string, fr: string }, primary: boolean // If true, tag will be shown in Suggestions list below tags field }
inlineType: boolean.
Default: false
If set to true, the plugin will be displayed as inline element in the element referred by the target property. Otherwise, it will pop up in a modal upon trigger, see below.
floatyType: boolean.
Default: false
configures the plugin to be floaty and stay in a fixed position as you scroll the media library.
Setting the
floatyattribute totrueoverride width and height to100%and it has an impact on some styles and behavior, eg. bigger spacings for some elements.
triggerType: string.
Default: null
The selector used for triggering the display of the plugin modal, if passed to querySelectorAll function. Available options:
body#filerobot-trigger-button or .filerobot-trigger-buttonMultiple triggers are supported as click events.
Required if inline: false
targetType: string Required.
Default: body
The selector used for displaying the plugin, if passed to querySelector function. Options:
body#filerobot-container or .filerobot-containerwidthType: number| string.
Default: 768
Width of the plugin as a number if specified in pixels or a percentage, eg. '50%'
heightType: number| string.
Default: 538
Height of the plugin as a number if specified in px or a percentage eg. '35%'
thumbnailWidthType: number.
Default: 280
Pixel width of the asset thumbnails displayed in the gallery. Apect ratio of images is kept in case of image assets.
thumbnailHeightType: number.
Default: 170
Pixel height of the asset thumbnails displayed in the gallery. Aspect ratio of images is kept in case of image assets.
noItemsBrowserType: boolean.
Default: false
Hides the Explorer view displaying files/folders and only allows the user to upload a single or multiple assets. In summary, if set to true it puts the upload page as default homepage and removes the gallery.
viewsType: array.
Default: ['ASSETS', 'COLLECTIONS', 'LABELS', 'FAVORITES', 'FOLDERS', 'PRODUCTS']
List of available views.
NOTE some views can be hidden if you don't have permission provided in securityTemplateId.
defaultViewType: string.
Default: ['FOLDERS']
View which will be opened by default.
layoutTypeType: boolean.
Default: grid
Specifies the default layout in the view:
| Value | Description |
|---|---|
grid |
shows folders/assets as cards in a grid |
list |
shows the folders/assets as rows in a table |
you can switch between layouts from the layout selector button in the right side in header bar.
waitForThumbnailsBeforeUploadType: boolean.
Default: false
If set to true, delays the start of the upload process until the asset thumbnails are generated and displayed in the plugin.
showBarType: boolean.
Default: true
If set to false, hides the top bar with Upload button, searchBar, create folder button and view button.
showProgressDetailsType: boolean.
Default: true
If set to false, hides the upload progress bar.
hideUploadButtonType: boolean.
Default: false
If set to true, hides the Upload button at the top of the plugin.
hideSearchType: boolean.
Default: false
Hides Search field at the top of the plugin.
hideCancelButtonType: boolean.
Default: false
Hides the Cancel button that is used to cancel an upload.
noteType: string.
Default: null
A custom note displayed in the upload screen.
closeModalOnClickOutsideType: boolean.
Default: false
Plugin modal will be closed when clicking outside of the modal.
Only relevant if inline: false
closeAfterFinishType: boolean.
Default: false
Modal will close after upload is finished.
closeAfterExportType: boolean.
Default: false
Modal will close after export.
closeUploadPanelAfterFinish: booleanType: boolean.
Default: false
The upload panel will be closed automatically and explorer would be shown.
Only relevant if inline: false
onClickDoneButtonType: function.
Default: () => {}
A callback function that would be triggered when the user clicks on done button that is shown in the uploads panel after the uploads finish
disableStatusBarType: boolean.
Default: false
Disables the status-bar plugin which shows the upload/download progress.
disableProgressPanelType: boolean.
Default: false
Disables the progress-panel plugin which shows progress/status of uploads, downloads, transformations activities inside a panel.
disableInformerType: boolean.
Default: false
Disables the informer plugin used to show warnings and errors.
disableThumbnailGeneratorType: boolean.
Default: false
Disables the thumbnail-generator plugin that generates image thumbnails.
disablePageScrollWhenModalOpenType: boolean.
Default: true
If set to true, disables scrolling for the document while the plugin modal is open.
Only relevant if inline: false
disableDownloadButtonPREVIOUSLY: disableExportButton & disableTopBarMainButton
Type: boolean.
Default: false
Hides the download button shown in the action bar when selecting files.
hideExportOptionsMenuType: boolean.
Default: false
Hides the export options menu at the action bar.
preventDownloadDefaultBehaviorPREVIOUSLY: preventExportDefaultBehavior
Type: boolean.
Default: false
Prevent default behavior of download/export.
hideDownloadButtonIconPREVIOUSLY: hideExportButtonIcon
Type: boolean.
Default: false
Hides the download/export button icon.
hideHeaderBarType: boolean.
Default: false
Hides the header bar, header bar contains breadcrumbs and other action buttons.
hideExportCropPanelPREVIOUSLY: disableExportCropPanel
Type: boolean.
Default: false
The crop button in the export options modal will be hidden.
forceDownloadType: boolean.
Default: false
Adds download=1 param to the CDN download link
defaultCollectionUuidType: string.
Default: null
Navigate to the collection view and open the provided collection.
Only relevant if Collections view is provided in views
defaultLabelSidType: string.
Default: null
Navigate to the labels view and open the provided label.
Only relevant if Labels view is provided in views
defaultFiltersType: object.
Default: null
Apply the provided filters on initial load.
defaultSearchQueryType: string.
Default: ''
Apply the provided search query on initial load.
imageEditorModeType: string.
Default: 'default'
Possible values: 'default' | 'cloudimage'
Set imageEditorMode for the image editor plugin.
defaultItemToFocusType: object.
Default: null
Navigate to the provided item and focus on mount
hideModalAfterExportType: boolean.
Default: false
Hides the modal after finish download/export.
closeAfterImageEditType: boolean.
Default: false
Hides the modal after finish editing image.
onRequestCloseModalType: () => undefined.
Default: closeModal function
Specified a custom function to be executed when trying to close the modal. Default closing modal behavior is overridden
Only relevant if inline: false
animateOpenCloseType: boolean.
Default: true
Disable the modal's opening and closing.
Only relevant if inline: false
localeType: object.
Default: locales from filerobot's backend then default locale file with all labels is under lib/defaultLocale.js.
You can override some labels by specifying a translation object here, such as:
{ strings: { baseFolderTitle: 'Root' // overrides the default Home value to Root } }
browserBackButtonCloseModalType: boolean.
Default: false
The browser Back button will close the modal, otherwise it will trigger the standard back browser behavior.
Only relevant if inline: false
enableFoldersStatsApiRequestType: boolean.
Default: false
When enabled it will send extra folders/stats API request with the folders request to get folders count.
isUploadBarAddMoreButtonHiddenType: boolean.
Default: false
The 'Add More' button in upload module is hidden preventing users to upload more item.
currentUserInfoType: object.
Default:
{ email: '', name: '' photo_uri : '', uuid : '' }
The info of current user using Filerobot Media Asset Widget mainly used in comments tab of file window and recognizing the user, it consists of:
| Property | Type | Default | Description |
|---|---|---|---|
name |
string required |
'' |
user name |
email |
string |
'' |
user email |
photo_uri |
string required |
'' |
user avatar link |
uuid |
string required |
'' |
user id |
showFoldersTreeType: boolean.
Default: false
Shows/hides on initial load the folder tree as a sidebar at the left of the plugin to navigate folders. The user can shows/hides the folder tree from the tree icon in the breadcrumbs.
Only relevant if folders view is provided in views
showProductsTreeType: boolean.
Default: false
Shows/hides on initial load the product tree as a sidebar at the left of the plugin to navigate products. The user can shows/hides the product tree from the tree icon in the breadcrumbs.
Only relevant if products view is provided in views
showCollectionsTreeType: boolean.
Default: false
Shows/hides the collection tree as a sidebar at the left of the plugin to navigate collections. The user can shows/hides the collection tree from the tree icon in the breadcrumbs.
Only relevant if collection view is provided in views
showLabelsTreeType: boolean.
Default: false
Shows/hides the label tree as a sidebar at the left of the plugin to navigate labels. The user can shows/hides the label tree from the tree icon in the breadcrumbs.
showDetailsViewType: boolean.
Default: false
Shows/hides the asset details view as a sidebar at the right of the plugin to view various details about selected assets. The user can shows/hides the details view from the info icon in the right side of the breadcrumbs.
contextMenuSubTabs Type: object.
Default:
{ fileMore: ['REMOVE_BACKGROUND','TRANSCODE_VIDEO'], fileShare: ['PUBLISH', 'MANAGE_ACCESS', 'GET_LINK', 'VIA_SHAREBOX', 'EMBED'] }
If you need to customize the sub tabs that are opened from the parent tabs of the context menu (the menu shown on clicking right click on the file/folder):
| Property | Type | Default | Description |
|---|---|---|---|
fileMore |
strings[] |
['REMOVE_BACKGROUND', 'TRANSCODE_VIDEO'] |
sub items for more Actions option inside assets's context menu |
fileShare |
strings[] |
['PUBLISH', 'MANAGE_ACCESS', 'GET_LINK', 'VIA_SHAREBOX', 'EMBED'] |
sub items for share option inside assets's context menu |
videoTranscodingType: object.
Default:
{ resolution: 'auto', protocol: 'HLS' }
Video transcoding options for post-upload video transcoding:
| Property | Type | Default | Description |
|---|---|---|---|
resolution |
string required |
auto |
target resolutions for video transcoding |
protocol |
string required |
HLS |
which protocol to use while transcoding |
cropPresetsType: object.
Default: {}
Defines additional crop types & presets besides the freehand one and their presets and its shape as follows
{ 'Social media': [ /** * label: possible to be a string or string in form of i18n key provided through locale object * value: value follows this format (width:height:autoResize) or one of the following stringy values (original/ellipse) which defines the width & height of the crop preset autoResize which is a boolean value if `true` then resizing inputs will be disabled and auto resize will be applied automatically otherwise they're enabled, ratio of crop will be determined from width / height. */ { label: 'Facebook profile', value: '400:400:true' }, { label: 'linkedInCover', value: '1128:191:false' } ], custom: [ { label: 'logoSize', value: '320:100' } ], ellipse: { label: 'ellipse', value: 'ellipse' }, original: { label: 'original', value: 'original' } }
NOTEThe object's keys will be used the label for crop type (it is possible to be label string or i18n key string that is provided through locale object)
showRemoveBackgroundOptionType: boolean.
Default: false
Remove background option will appear in context menu.
disableMultipleSelectType: boolean.
Default: false
Multiple files/folders selections will be disabled and only 1 file/folder possible to be selected.
dismissUrlPathQueryUpdateType: boolean.
Default: false
The url query fmaw_path won't be added/updated to the current url.
showFilerobotCopyrightType: boolean.
Default: true
Hides filerobot copyright at the bottom of the plugin.
noImgOperationsAndDownloadType: boolean.
Default: false
If set to true, hides some options in asset contextual menu:
disableFoldersContextMenuType: boolean.
Default: false
If set to true, will disable and hide the contextual menu of folders.
disableFolderSelectionType: boolean.
Default: false
If set to true, will disable the selection of folders.
viewerModeType: boolean.
Default: false
If set to true, will hide and prevent the actions of editing.
explorerWrapperClassNameType: string.
Default: null
ClassName(s) to add to the explorer wrapper.
disableListLayoutType: boolean.
Default: false
If set to true, will hide the button and prevent the possiblity to switch from grid view to list view.
hideFileOptionsType: boolean.
Default: false
If set to true, will hide the options appear at the top of the file item.
hideFolderOptionsType: boolean.
Default: false
If set to true, will hide the options appear at the top of the folder item.
replaceDownloadButtonWithExportType: boolean.
Default: false
If set to true, will replace the default download button with export button.
queryParamPrefixType: string.
Default: fmaw_
Override the query params
showDragDropPanelType: boolean.
Default: false
Changes the design for the addFiles panel in uploads.
showSortType: boolean.
Default: true
shows/hides sort button in Explorer.
isDownloadUsageRightsEnabledType: boolean.
Default: false
Enables/disables the download of usage rights file with assets.