@scaleflex/widget-explorer 4.0.7 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +12145 -12100
  2. package/LICENSE +21 -21
  3. package/README.md +1267 -1235
  4. package/dist/style.css +1438 -1094
  5. package/dist/style.min.css +1 -1
  6. package/lib/components/AssetsList/SearchView.hook.js +24 -24
  7. package/lib/components/AssetsList/__SearchTestPannel.js +27 -27
  8. package/lib/components/BulkEditPanel/components/AssetsList/Columns/columns.utils.js +2 -2
  9. package/lib/components/CropPanel/index.scss +55 -55
  10. package/lib/components/Details/FileItem/style.scss +11 -11
  11. package/lib/components/Drawer/ResizerCore.js +3 -3
  12. package/lib/components/FileItem/PreUploadFileThumbnail/index.scss +19 -19
  13. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralSection.js +1 -1
  14. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.constants.js +7 -3
  15. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.styled.js +4 -2
  16. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.thunks.js +45 -0
  17. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsContent.js +15 -1
  18. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabs.js +11 -3
  19. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTopOptions.js +4 -4
  20. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +194 -27
  21. package/lib/components/FileWindowPanel/Header/BeforeUploadActionBtns.js +4 -4
  22. package/lib/components/FoldersView/index.js +29 -3
  23. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.utils.js +3 -3
  24. package/lib/components/GalleryRoleSelect/index.js +11 -11
  25. package/lib/components/Modals/AddNewFolder/AddNewFolder.hooks.js +99 -0
  26. package/lib/components/Modals/AddNewFolder/index.js +1 -0
  27. package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +11 -11
  28. package/lib/components/Modals/TransformedDownload/TransformedDownload.utils.js +4 -4
  29. package/lib/components/Modals/index.js +1 -0
  30. package/lib/components/TopBar/index.scss +20 -20
  31. package/lib/components/UrlBuilderModal/index.js +6 -2
  32. package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.utils.js +12 -8
  33. package/lib/components/metadata.adapter.js +18 -18
  34. package/lib/defaultLocale.js +8 -1
  35. package/lib/hooks/useEditFileDetails.js +5 -5
  36. package/lib/hooks/useFileMetadata.js +5 -3
  37. package/lib/hooks/useIsSmallScreen.js +6 -6
  38. package/lib/hooks/useValidateFileName.js +22 -22
  39. package/lib/index.js +155 -151
  40. package/lib/slices/files.slice.js +15 -15
  41. package/lib/slices/folders.slice.js +9 -9
  42. package/lib/slices/metadata.slice.js +9 -2
  43. package/lib/style.scss +268 -268
  44. package/lib/utils/SearchSuggestions/SearchSuggestionsMenu.js +4 -4
  45. package/lib/utils/createSuperFocus.js +5 -5
  46. package/lib/utils/filters.js +3 -3
  47. package/lib/utils/formatPinSubTitle.js +6 -6
  48. package/lib/utils/getActiveOverlayEl.js +2 -2
  49. package/lib/utils/truncateString.js +7 -7
  50. package/package.json +8 -8
  51. package/types/index.d.ts +102 -102
package/README.md CHANGED
@@ -1,1236 +1,1268 @@
1
- # `@scaleflex/widget-explorer`
2
-
3
- [![Plugins][plugins-image]](#plugins)
4
- [![Website][filerobot-image]][sfx-url]
5
- [![Version][filerobot-version]][version-url]
6
- [![Scaleflex team][made-by-image]][sfx-url]
7
- [![License][license-image]][license-url]
8
- [![CodeSandbox][codeSandbox-image]][codeSandbox-url]
9
-
10
- <div align='center'>
11
- <img title="Scaleflex Widget logo" alt="Scaleflex Widget logo" src="https://assets.scaleflex.com/Corporate+Branding/%5B2025%5D+ALL+LOGOS+%2B+ICONS/SCALEFLEX/VXP+logo/Horizontal+White/VXP+logo+WHITE.png?vh=663932" width="140"/>
12
- </div>
13
-
14
- The file Explorer and media gallery plugin of the [Scaleflex Media Asset Widget](https://www.npmjs.com/package/@scaleflex/widget-core).
15
-
16
- ## Usage
17
-
18
- ### NPM
19
-
20
- ```bash
21
- npm install --save @scaleflex/widget-explorer
22
- ```
23
-
24
- ### YARN
25
-
26
- ```bash
27
- yarn add @scaleflex/widget-explorer
28
- ```
29
-
30
- then
31
-
32
- ```js
33
- import Explorer from '@scaleflex/widget-explorer'
34
- ...
35
- ...
36
- ...
37
- scaleflexWidget.use(Explorer, propertiesObject)
38
- ```
39
-
40
- ### CDN
41
-
42
- If installed via a [CDN link](../@scaleflex/widget-core#installation), the plugin is inside the `Scaleflex` global object as `Scaleflex.Explorer`
43
-
44
- ```js
45
- const Explorer = window.ScaleflexWidget.Explorer
46
- ...
47
- ...
48
- ...
49
- scaleflexWidget.use(Explorer, propertiesObject)
50
- ```
51
-
52
- ### Plugin styles
53
-
54
- ```js
55
- import "@scaleflex/widget-core/dist/style.css";
56
- import "@scaleflex/widget-explorer/dist/style.css";
57
- ```
58
-
59
- or via the minified versions
60
-
61
- ```js
62
- import "@scaleflex/widget-core/dist/style.min.css";
63
- import "@scaleflex/widget-explorer/dist/style.min.css";
64
- ```
65
-
66
- > The plugin's css file should be imported after the [Core's css file](../@scaleflex/widget-core/#modules-styles) for having the styles shown correctly.
67
-
68
- ## Explorer modes
69
-
70
- ### Uploader mode (default mode)
71
-
72
- The mode used for uploading files using your chosen/configured uploading provider to your token and chosen path.
73
-
74
- #### how to?
75
-
76
- Just initialize the widget normally and keep [`ExploreViewComponent`](#exploreviewcomponent) property in Explorer plugin with a null/empty value.
77
-
78
- ```js
79
- // ScaleflexWidget.Core initializations
80
- scaleflexWidget.use(Explorer, {
81
- // ...otherParams,
82
- ExploreViewComponent: null
83
- })
84
- scaleflexWidget.use(XHRUpload, {
85
- uploadToFolderPath: '/test'
86
- })
87
- ```
88
-
89
- ### Browser/Light-DAM mode
90
-
91
- The mode used for browsing files/folders using the Explorer's main view and do some light-weight/quick functionalities like reading & writing files metadata in addition to uploading files.
92
-
93
- #### how to?
94
-
95
- Initialize the plugin with providing the component `@scaleflex/widget-explorer/lib/components/ExploreView` to the [`ExploreViewComponent`](#exploreviewcomponent) property.
96
-
97
- ```js
98
- import ExploreView from '@scaleflex/widget-explorer/lib/components/ExploreView'
99
- // ...scaleflexWidget and other plugins initializations
100
-
101
- scaleflexWidget.use(Explorer, {
102
- // ...otherParams,
103
- ExploreViewComponent: ExploreView
104
- })
105
- ```
106
-
107
- ### Assets picker mode
108
-
109
- Enabling the ability to browse the files/folders and preview them with and their metadata. Select files from the current token and do your own custom functionality after selecting the files.
110
-
111
- #### how to?
112
-
113
- 1. Initialize the plugin and provide the component `@scaleflex/widget-explorer/lib/components/ExploreView` to the [`ExploreViewComponent`](#exploreviewcomponent) property.
114
- 2. provide `useAssetsPicker` property with a `true` value.
115
-
116
- ```js
117
- import ExploreView from '@scaleflex/widget-explorer/lib/components/ExploreView'
118
- // ...scaleflexWidget and other plugins initializations
119
-
120
- scaleflexWidget.use(Explorer, {
121
- // ...otherParams,
122
- ExploreViewComponent: ExploreView,
123
- useAssetsPicker: true,
124
- hideDownloadButtonIcon: true
125
- })
126
- ```
127
-
128
- > Note: please check the plugin's properties in-case you want to customize anything else related to any of the mentioned 3 modes above (some of the properties might work only for specific mode).
129
-
130
- ## Properties
131
-
132
- The Explorer supports multiple properties to customize the plugin according to your needs. Required attributes are marked with **_(Required)_**.
133
-
134
-
135
- ### `locale` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
136
-
137
- <u>Type:</u> `object`.
138
-
139
- <u>Default:</u> locales from scaleflexWidget's backend then default locale file with all labels is under `lib/defaultLocale.js`.
140
-
141
- You can override some labels by specifying a translation object here, such as:
142
-
143
- ```js
144
- {
145
- strings: {
146
- baseFolderTitle: "Root"; // overrides the default Home value to Root
147
- }
148
- }
149
- ```
150
-
151
- ### `config` ![asset-picker-supported] ![asset-manager-supported]
152
-
153
- <u>Type:</u> `object`
154
-
155
- <u>Default:</u>
156
-
157
- ```js
158
- {
159
- config: {
160
- foldersLimit: 200,
161
- filesLimit: 50,
162
- rootFolderPath: '/',
163
- defaultSort: {
164
- by: '',
165
- order: ''
166
- },
167
- tagging: {...} // check tagging section
168
- }
169
- }
170
- ```
171
-
172
- The config objects contains the main configuration for the plugin to interact with your Scaleflex project:
173
-
174
- #### `foldersLimit` ![asset-picker-supported] ![asset-manager-supported]
175
-
176
- <u>Type:</u> `number`.
177
-
178
- <u>Default:</u> `200`
179
-
180
- Number of folders to be retrieved with folders initial request.
181
-
182
- #### `maxCountOfSelectedFiles` ![asset-picker-supported] ![asset-manager-supported]
183
-
184
- <u>Type:</u> `number`.
185
-
186
- <u>Default:</u> `undefined`
187
-
188
- Maximum number of files that can be selected.
189
-
190
- #### `filesLimit` ![asset-picker-supported] ![asset-manager-supported]
191
-
192
- <u>Type:</u> `number`.
193
-
194
- <u>Default:</u> `50`
195
-
196
- Number of files to be retrieved with files initial request.
197
-
198
- #### `rootFolderPath` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
199
-
200
- <u>Type:</u> `string`.
201
-
202
- <u>Default:</u> `/`
203
-
204
- Overrides the root folder path when there is no `list scope` linked with the [securityTemplateId](..@scaleflex/widget-core/README.md/#securitytemplateid) or at least 2 folders or more in the `list scope` otherwise it has no effect.
205
-
206
- > Note: If the [securityTemplateId](..@scaleflex/widget-core/README.md/#securitytemplateid) has 2 folders at least, then the provided folder path must be one of these folders or one of their sub-folders.
207
-
208
- #### `defaultSort` ![asset-picker-supported] ![asset-manager-supported]
209
-
210
- <u>Type:</u> `object`.
211
-
212
- <u>Default:</u> `{ by: 'name', order: 'asc' }`
213
-
214
- Customize the default selected sort option for both files & folders shown in the main view (not applicable for folders tree or objects' trees) applied for all the files shown regardless of the opened view.
215
-
216
- The options available sorting
217
-
218
- | Property | Type | Default | Description |
219
- | ----------- | -------- | ------- | --------------------------------------------------------------------------------------------------------- |
220
- | **`by`** | `string` | `name` | Defines the default sort by param, should be one of ['name', 'created_at', 'modified_at', 'size', 'type'] |
221
- | **`order`** | `string` | `asc` | Defines the default sort order param, should be one of ['asc', 'desc'] |
222
-
223
- > Note: its value is considered only on plugin's install/mount.
224
-
225
- #### `defaultSearchSort` ![asset-picker-supported] ![asset-manager-supported]
226
-
227
- <u>Type:</u> `object`.
228
-
229
- <u>Default:</u>
230
-
231
- ```js
232
- {
233
- text: {
234
- by: 'name',
235
- order: 'asc'
236
- }
237
- }
238
- ```
239
-
240
- Customize the default selected sort option for search shown in the main view, applied for all the files shown regardless of the opened view.
241
-
242
- The options available sorting
243
-
244
- | Property | Type | Default | Description |
245
- | ---------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
246
- | **text.`by`** | `string` | `name` | Defines the default search sort by param, should be one of ['relevance', 'name', 'created_at', 'modified_at', 'size', 'type'] |
247
- | **text.`order`** | `string` | `asc` | Defines the default search sort order param, should be one of ['asc', 'desc'] |
248
-
249
- #### `tagging` ![asset-manager-supported]
250
-
251
- <u>Type:</u> `object`.
252
-
253
- <u>Default:</u>
254
-
255
- ```js
256
- {
257
- tagging: {
258
- enabled: false,
259
- autoTagging: false,
260
- suggestedTagsOnly: false,
261
- language: 'en',
262
- confidence: 60,
263
- limit: 10,
264
- provider: 'google',
265
- suggestionList: []
266
- }
267
- }
268
- ```
269
-
270
- The options available for tagging
271
-
272
- | Property | Type | Default | Description |
273
- | ----------------------- | ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
274
- | **`enabled`** | `boolean` | `false` | Enable/disable tags |
275
- | **`autoTagging`** | `boolean` | `false` | Enable/disable auto-tagging |
276
- | **`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. |
277
- | **`language`** | `string` | `en` | AutoTagging config that we add in POST process/autoTag request data.meta |
278
- | **`confidence`** | `number` | `60` | AutoTagging config that we add in POST process/autoTag request data.meta |
279
- | **`limit`** | `number` | `10` | AutoTagging config that we add in POST process/autoTag request data.meta |
280
- | **`provider`** | `string` | `[]` | AutoTagging config that we add in POST process/autoTag request data.meta |
281
- | **`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: |
282
-
283
- ```js
284
- {
285
- sid: string, // Short id like: '#tg1885f'
286
- names: {
287
- en: string,
288
- fr: string
289
- },
290
- primary: boolean // If true, tag will be shown in Suggestions list below tags field
291
- }
292
- ```
293
-
294
- ### `inline` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
295
-
296
- <u>Type:</u> `boolean`.
297
-
298
- <u>Default:</u> `false`
299
-
300
- If set to `true`, the plugin will be displayed as inline element in the element referred by the [target](#target) property. Otherwise, it will pop up in a modal upon [trigger](#trigger), see below.
301
-
302
- ### `trigger` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
303
-
304
- <u>Type:</u> `string`.
305
-
306
- <u>Default:</u> `null`
307
-
308
- The selector used for triggering the display of the plugin modal, if passed to `querySelectorAll` function. Available options:
309
-
310
- - HTML tag, eg. `body`
311
- - CSS selector, eg. `#scaleflex-widget-trigger-button` or `.scaleflex-widget-trigger-button`
312
-
313
- Multiple triggers are supported as click events.
314
-
315
- > **_Required if_** [inline](#inline): false
316
-
317
- ### `target` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
318
-
319
- <u>Type:</u> `string`.
320
-
321
- <u>Default:</u> ``
322
-
323
- The selector used for displaying the plugin, if passed to `querySelector` function. Options:
324
-
325
- - HTML tag, eg. `body`
326
- - CSS selector, eg. `#scaleflex-widget-container` or `.scaleflex-widget-container`
327
-
328
- > **_Required if_** [inline](#inline): false
329
-
330
- ### `width` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
331
-
332
- <u>Type:</u> `number`| `string`.
333
-
334
- <u>Default:</u> `768`
335
-
336
- Width of the plugin as a number if specified in pixels or a percentage, eg. `'50%'`
337
-
338
- ### `height` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
339
-
340
- <u>Type:</u> `number`| `string`.
341
-
342
- <u>Default:</u> `538`
343
-
344
- Height of the plugin as a number if specified in `px` or a percentage eg. `'35%'`
345
-
346
- ### `thumbnailWidth` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
347
-
348
- <u>Type:</u> `number`.
349
-
350
- <u>Default:</u> `280`
351
-
352
- Pixel width of the asset thumbnails displayed in the uploads panel. Apect ratio of images is kept in case of image assets.
353
-
354
- ### `thumbnailHeight` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
355
-
356
- <u>Type:</u> `number`.
357
-
358
- <u>Default:</u> `170`
359
-
360
- Pixel height of the asset thumbnails displayed in the uploads panel. Aspect ratio of images is kept in case of image assets.
361
-
362
- ### `ExploreViewComponent` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
363
-
364
- <u>Type:</u> `ReactComponent`.
365
-
366
- <u>Default:</u> `null`
367
-
368
- <u>Expected value:</u> `@scaleflex/widget-explorer/lib/components/ExploreView`
369
-
370
- The view component that is responsible about showing the objects (folders/files...etc.) with the possibility to browse them and enable other functionalities.
371
-
372
- ### `mutedFilesUuids` ![asset-picker-supported] ![asset-manager-supported]
373
-
374
- <u>Type:</u> `array`.
375
-
376
- <u>Default:</u> `[]`
377
-
378
- List of file UUIDs with the state "muted". These files cannot be selected or have any actions performed on them.
379
-
380
- ### `views` ![asset-picker-supported] ![asset-manager-supported]
381
-
382
- <u>Type:</u> `array`.
383
-
384
- <u>Default:</u> `['ASSETS', 'FOLDERS']`
385
-
386
- List of available views.
387
-
388
- > **NOTE** some views can be hidden if you don't have permission provided in [securityTemplateId](..@scaleflex/widget-core/README.md/#securitytemplateid).
389
-
390
- ### `view` ![asset-picker-supported] ![asset-manager-supported]
391
-
392
- <u>Type:</u> `string`.
393
-
394
- <u>Default:</u> `'FOLDERS'`
395
-
396
- View which will be currently opened.
397
-
398
- ### `viewItem` ![asset-picker-supported] ![asset-manager-supported]
399
-
400
- <u>Type:</u> `string`.
401
-
402
- <u>Default:</u> `null`
403
-
404
- Open the provided view's item/object for ex. (folders view => folder path, labels view => label sid or uuid ...etc.)
405
-
406
- > Note: No auto redirect to the view, you have to provide the proper view from [`view prop`](#view).
407
-
408
- ### `viewSubItem` ![asset-picker-supported] ![asset-manager-supported]
409
-
410
- <u>Type:</u> `string`.
411
-
412
- <u>Default:</u> `null`
413
-
414
- A sub item that should be opened inside the provided [`view`](#view) & [`viewItem`](#viewitem).
415
-
416
- > Note: No auto redirect to the view, you have to provide the proper view from [`view prop`](#view).
417
-
418
- ### `layoutType` ![asset-picker-supported] ![asset-manager-supported]
419
-
420
- <u>Type:</u> `boolean`.
421
-
422
- <u>Default:</u> `grid`
423
-
424
- Specifies the default layout in the view:
425
-
426
- | Value | Description |
427
- | ---------- | ------------------------------------------- |
428
- | **`grid`** | shows folders/assets as cards in a grid |
429
- | **`list`** | shows the folders/assets as rows in a table |
430
-
431
- you can switch between layouts from the layout selector button in the right side in header bar.
432
-
433
- ### `waitForThumbnailsBeforeUpload` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
434
-
435
- <u>Type:</u> `boolean`.
436
-
437
- <u>Default:</u> `false`
438
-
439
- If set to `true`, delays the start of the upload process until the asset thumbnails are generated and displayed in the plugin.
440
-
441
- ### `showBar` ![asset-picker-supported] ![asset-manager-supported]
442
-
443
- <u>Type:</u> `boolean`.
444
-
445
- <u>Default:</u> `true`
446
-
447
- If set to `false`, hides the top bar with **Upload** button, searchBar, create folder button and view button.
448
-
449
- ### `showImportFromDamButton` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
450
-
451
- <u>Type:</u> `boolean`.
452
-
453
- <u>Default:</u> `false`
454
-
455
- If set to `true`, shows the **Import from DAM** button in the uploads panel to upload from DAM.
456
-
457
- > Note: this property requires `ExploreViewComponent` to be provided to be able to browse the objects.
458
-
459
- ### `disableUpload` ![asset-picker-supported] ![asset-manager-supported]
460
-
461
- <u>Type:</u> `boolean`.
462
-
463
- <u>Default:</u> `false`
464
-
465
- If set to `true`, hides the **Upload** button at the top of the plugin.
466
-
467
- ### `hideSearch` ![asset-picker-supported] ![asset-manager-supported]
468
-
469
- <u>Type:</u> `boolean`.
470
-
471
- <u>Default:</u> `false`
472
-
473
- Hides **Search** field at the top of the plugin.
474
-
475
- ### `note` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
476
-
477
- <u>Type:</u> `string`.
478
-
479
- <u>Default:</u> `null`
480
-
481
- A custom note displayed in the upload screen for drag&drop.
482
-
483
- ### `hint` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
484
-
485
- <u>Type:</u> `string`.
486
-
487
- <u>Default:</u> `null`
488
-
489
- A custom hint displayed in the upload screen at the bottom.
490
-
491
- ### `closeModalOnClickOutside` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
492
-
493
- <u>Type:</u> `boolean`.
494
-
495
- <u>Default:</u> `false`
496
-
497
- Plugin modal will be closed when clicking outside of the modal.
498
-
499
- > **_Only relevant if_** [inline](#inline): false
500
-
501
- ### `preventModalOverlayClickOnUpload` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
502
-
503
- <u>Type:</u> `boolean`.
504
-
505
- <u>Default:</u> `false`
506
-
507
- Plugin modal still opened when click outside of it, if there's selected files to be uploaded
508
-
509
- > **_Only relevant if_** [closeModalOnClickOutside](#closeModalOnClickOutside): true
510
-
511
- ### `closeAfterFinish` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
512
-
513
- <u>Type:</u> `boolean`.
514
-
515
- <u>Default:</u> `false`
516
-
517
- Modal will close after upload is finished.
518
-
519
- > **_Only relevant if_** [inline](#inline): false
520
-
521
- ### `closeAfterUploadStart` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
522
-
523
- <u>Type:</u> `boolean`.
524
-
525
- <u>Default:</u> `false`
526
-
527
- Modal will close after upload is started.
528
-
529
- > **_Only relevant if_** [inline](#inline): false
530
-
531
- ### `onClickUploadButton` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
532
-
533
- <u>Type:</u> `function`.
534
-
535
- <u>Default:</u> `() => {}`
536
-
537
- A callback function that would be triggered when the user clicks on upload button that is shown in the uploads panel, if returned `true` then the default upload functionality won't be triggered.
538
-
539
- ### `disableInformer` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
540
-
541
- <u>Type:</u> `boolean`.
542
-
543
- <u>Default:</u> `false`
544
-
545
- Disables the [informer](../@scaleflex/widget-informer/#scaleflexwidget-informer) plugin used to show warnings and errors.
546
-
547
- ### `disableThumbnailGenerator` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
548
-
549
- <u>Type:</u> `boolean`.
550
-
551
- <u>Default:</u> `false`
552
-
553
- Disables the [thumbnail-generator](../@scaleflex/widget-thumbnail-generator/#scaleflexwidget-thumbnail-generator) plugin that generates image thumbnails.
554
-
555
- ### `disablePageScrollWhenModalOpen` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
556
-
557
- <u>Type:</u> `boolean`.
558
-
559
- <u>Default:</u> `true`
560
-
561
- If set to `true`, disables scrolling for the document while the plugin modal is open.
562
-
563
- > **_Only relevant if_** [inline](#inline): false
564
-
565
- ### `disableDownloadButton` ![asset-picker-supported] ![asset-manager-supported]
566
-
567
- <u>Type:</u> `boolean`.
568
-
569
- <u>Default:</u> `false`
570
-
571
- Hides the download button shown in the action bar when selecting files.
572
-
573
- ### `preventDownloadDefaultBehavior` ![asset-picker-supported] ![asset-manager-supported]
574
-
575
- <u>Type:</u> `boolean`.
576
-
577
- <u>Default:</u> `false`
578
-
579
- Prevent default behavior of download/export.
580
-
581
- ### `hideDownloadVariationsOption` ![asset-picker-supported] ![asset-manager-supported]
582
-
583
- <u>Type:</u> `boolean`.
584
-
585
- <u>Default:</u> `false`
586
-
587
- Hide transformation in download options in context menu and action bar.
588
-
589
- ### `hideDownloadButtonIcon` ![asset-picker-supported] ![asset-manager-supported]
590
-
591
- <u>Type:</u> `boolean`.
592
-
593
- <u>Default:</u> `false`
594
-
595
- Hides the download/export button icon.
596
-
597
- ### `hideHeaderBar` ![asset-picker-supported] ![asset-manager-supported]
598
-
599
- <u>Type:</u> `boolean`.
600
-
601
- <u>Default:</u> `false`
602
-
603
- Hides the header bar, header bar contains breadcrumbs and other action buttons.
604
-
605
- ### `hideExportCropPanel` ![asset-picker-supported] ![asset-manager-supported]
606
-
607
- <u>Type:</u> `boolean`.
608
-
609
- <u>Default:</u> `false`
610
-
611
- The crop button in the export options modal will be hidden.
612
-
613
- ### `forceDownload` ![asset-picker-supported] ![asset-manager-supported]
614
-
615
- <u>Type:</u> `boolean`.
616
-
617
- <u>Default:</u> `false`
618
-
619
- Adds `download=1` param to the CDN download link
620
-
621
- ### `imageEditorMode` ![asset-manager-supported]
622
-
623
- <u>Type:</u> `string`.
624
-
625
- <u>Default:</u> `'default'`
626
-
627
- Possible values: `'default' | 'cloudimage' `
628
-
629
- Set imageEditorMode for the image editor plugin.
630
-
631
- ### `hideModalAfterExport` ![asset-picker-supported] ![asset-manager-supported]
632
-
633
- <u>Type:</u> `boolean`.
634
-
635
- <u>Default:</u> `false`
636
-
637
- Hides the modal after finish download/export.
638
-
639
- ### `closeAfterImageEdit` ![asset-manager-supported]
640
-
641
- <u>Type:</u> `boolean`.
642
-
643
- <u>Default:</u> `false`
644
-
645
- Hides the modal after finish editing image.
646
-
647
- ### `onRequestCloseModal` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
648
-
649
- <u>Type:</u> `() => undefined`.
650
-
651
- <u>Default:</u> `closeModal` function
652
-
653
- Specified a custom function to be executed when trying to close the modal. Default closing modal behavior is overridden
654
-
655
- > **_Only relevant if_** [inline](#inline): false
656
-
657
- ### `animateOpenClose` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
658
-
659
- <u>Type:</u> `boolean`.
660
-
661
- <u>Default:</u> `true`
662
-
663
- Disable the modal's opening and closing.
664
-
665
- > **_Only relevant if_** [inline](#inline): false
666
-
667
- ### `browserBackButtonCloseModal` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
668
-
669
- <u>Type:</u> `boolean`.
670
-
671
- <u>Default:</u> `false`
672
-
673
- The browser **Back** button will close the modal, otherwise it will trigger the standard back browser behavior.
674
-
675
- > **_Only relevant if_** [inline](#inline): false
676
-
677
- ### `enableFoldersStatsApiRequest` ![asset-picker-supported] ![asset-manager-supported]
678
-
679
- <u>Type:</u> `boolean`.
680
-
681
- <u>Default:</u> `false`
682
-
683
- When enabled it will send extra folders/stats API request with the folders request to get folders count.
684
-
685
- ### `isUploadBarAddMoreButtonHidden` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
686
-
687
- <u>Type:</u> `boolean`.
688
-
689
- <u>Default:</u> `false`
690
-
691
- The 'Add More' button in upload module is hidden preventing users to upload more item.
692
-
693
- ### `showFoldersTree` ![asset-picker-supported] ![asset-manager-supported]
694
-
695
- <u>Type:</u> `boolean`.
696
-
697
- <u>Default:</u> `false`
698
-
699
- 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.
700
-
701
- > **_Only relevant if_** folders view is provided in [views](#views)
702
-
703
- ### `showDetailsView` ![asset-picker-supported] ![asset-manager-supported]
704
-
705
- <u>Type:</u> `boolean`.
706
-
707
- <u>Default:</u> `false`
708
-
709
- 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.
710
-
711
- ### `hideDetailsViewButton` ![asset-picker-supported] ![asset-manager-supported]
712
-
713
- <u>Type:</u> `boolean`.
714
-
715
- <u>Default:</u> `false`
716
-
717
- Hides the asset details view button from the info icon in the right side of the breadcrumbs.
718
-
719
- ### `videoTranscoding` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
720
-
721
- <u>Type:</u> `object`.
722
-
723
- <u>Default:</u>
724
-
725
- ```js
726
- {
727
- resolution: 'auto',
728
- protocol: 'HLS'
729
- }
730
- ```
731
-
732
- Video transcoding options for post-upload video transcoding:
733
-
734
- | Property | Type | Default | Description |
735
- | ---------------- | ------------------- | ------- | ---------------------------------------- |
736
- | **`resolution`** | `string` _required_ | `auto` | target resolutions for video transcoding |
737
- | **`protocol`** | `string` _required_ | `HLS` | which protocol to use while transcoding |
738
-
739
- ### `cropPresets` ![asset-picker-supported] ![asset-manager-supported]
740
-
741
- <u>Type:</u> `object`.
742
-
743
- <u>Default:</u> `{}`
744
-
745
- Defines additional crop types & presets besides the freehand one and their presets and its shape as follows
746
-
747
- ```js
748
- {
749
- 'Social media': [
750
- /**
751
- * label: possible to be a string or string in form of i18n key provided through locale object
752
- * 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.
753
- */
754
- { label: 'Facebook profile', value: '400:400:true' },
755
- { label: 'linkedInCover', value: '1128:191:false' }
756
- ],
757
- custom: [
758
- { label: 'logoSize', value: '320:100' }
759
- ],
760
- ellipse: {
761
- label: 'ellipse', value: 'ellipse'
762
- },
763
- original: {
764
- label: 'original', value: 'original'
765
- }
766
- }
767
- ```
768
-
769
- > NOTE: The 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)
770
-
771
- ### `disableMultipleSelect` ![asset-picker-supported] ![asset-manager-supported]
772
-
773
- <u>Type:</u> `boolean`.
774
-
775
- <u>Default:</u> `false`
776
-
777
- Multiple files/folders selections will be disabled and only 1 file/folder possible to be selected.
778
-
779
- ### `dismissUrlPathQueryUpdate` ![asset-picker-supported] ![asset-manager-supported]
780
-
781
- <u>Type:</u> `boolean`.
782
-
783
- <u>Default:</u> `false`
784
-
785
- The url query `fmaw_path` won't be added/updated to the current url.
786
-
787
- ### `showScaleflexCopyright` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
788
-
789
- <u>Type:</u> `boolean`.
790
-
791
- <u>Default:</u> `false`
792
-
793
- Hides Scaleflex copyright at the bottom of the plugin.
794
-
795
- ### `useAssetsPicker` ![asset-picker-supported]
796
-
797
- <u>Type:</u> `boolean`.
798
-
799
- <u>Default:</u> `false`
800
-
801
- If set to `true`, actions like deleting, editing, or downloading assets will not be allowed, explore and insert actions allowed.
802
-
803
- ### `assetsPickerModelTitle` ![asset-picker-supported]
804
-
805
- <u>Type:</u> `string`.
806
-
807
- <u>Default:</u> `explorerTopSectionImportFileTitle`
808
-
809
- changing it's value changes the asset picker's model title
810
-
811
- ### `disableFolderSelection` ![asset-manager-supported]
812
-
813
- <u>Type:</u> `boolean`.
814
-
815
- <u>Default:</u> `false`
816
-
817
- If set to `true`, disable the possiblity to select folder(s).
818
-
819
- ### `hideFolderOptions` ![asset-manager-supported]
820
-
821
- <u>Type:</u> `boolean`.
822
-
823
- <u>Default:</u> `false`
824
-
825
- If set to `true`, hide the folder item top options.
826
-
827
- ### `hideDetailsSidebarButton` ![asset-picker-supported] ![asset-manager-supported]
828
-
829
- <u>Type:</u> `boolean`.
830
-
831
- <u>Default:</u> `false`
832
-
833
- If set to `true`, hide toggle details sidebar button.
834
-
835
- ### `hideActionBarSelectionButtons` ![asset-picker-supported] ![asset-manager-supported]
836
-
837
- <u>Type:</u> `boolean`.
838
-
839
- <u>Default:</u> `false`
840
-
841
- If set to `true`, hide the selection buttons in the action bar.
842
-
843
- ### `disableDnDActions` ![asset-picker-supported] ![asset-manager-supported]
844
-
845
- <u>Type:</u> `boolean`.
846
-
847
- <u>Default:</u> `false`
848
-
849
- If set to `true`, disable the drag and drop actions to move assets/folders or upload
850
-
851
- ### `noImgOperationsAndDownload` ![asset-picker-supported] ![asset-manager-supported]
852
-
853
- <u>Type:</u> `boolean`.
854
-
855
- <u>Default:</u> `false`
856
-
857
- If set to `true`, hides some options in asset contextual menu:
858
-
859
- - Download (context menu)
860
- - Transformation (action bar)
861
- - Edit image (context menu and action bar)
862
-
863
- ### `queryParamPrefix` ![asset-picker-supported] ![asset-manager-supported]
864
-
865
- <u>Type:</u> `string`.
866
-
867
- <u>Default:</u> `fmaw_`
868
-
869
- Override the query params
870
-
871
- ### `showDragDropPanel` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
872
-
873
- <u>Type:</u> `boolean`.
874
-
875
- <u>Default:</u> `false`
876
-
877
- Changes the design for the addFiles panel in uploads.
878
-
879
- ### `showSort` ![asset-picker-supported] ![asset-manager-supported]
880
-
881
- <u>Type:</u> `boolean`.
882
-
883
- <u>Default:</u> `true`
884
-
885
- shows/hides sort button in Explorer.
886
-
887
- ### `isDownloadUsageRightsEnabled` ![asset-picker-supported] ![asset-manager-supported]
888
-
889
- <u>Type:</u> `boolean`.
890
-
891
- <u>Default:</u> `false`
892
-
893
- Enables/disables the download of usage rights file with assets.
894
-
895
- ### `useLoginMode` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
896
-
897
- <u>Type:</u> `boolean`.
898
-
899
- <u>Default:</u> `false`
900
-
901
- Enables/disables the login mode which gives the user the possibility to login by his credentials (email & password) through a form shown to the user while using the widget, respecting the provided `container` in the core class of the widget.
902
-
903
- > Note: Don't provide security template key nor sass key if you need to use enable this feature by providing its value to `true`.
904
-
905
- ### `prefilledLoginModeEmail` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
906
-
907
- <u>Type:</u> `string`.
908
-
909
- <u>Default:</u> `null`
910
-
911
- The property used to add a default email address in the email address field of the login mode form, if not provided the email address will be empty. In both cases, the user will be able to change/add his email address and this property is used by having [`useLoginMode`](#useloginmode) enabled.
912
-
913
- ### `hideAddingComment` ![asset-manager-supported]
914
-
915
- <u>Type:</u> `boolean`.
916
-
917
- <u>Default:</u> `false`
918
-
919
- Removes the add comment textarea from the comments tab.
920
-
921
- ### `findAssetLocationEnabled` ![asset-manager-supported]
922
-
923
- <u>Type:</u> `boolean`.
924
-
925
- <u>Default:</u> `true`
926
-
927
- Providing `false`, will hide `Open asset location` option in the context menu and file window.
928
-
929
- ### `restrictedSearchContext` ![asset-picker-supported] ![asset-manager-supported]
930
-
931
- <u>Type:</u> `boolean`.
932
-
933
- <u>Default:</u> `false`
934
-
935
- Providing `true`, will disable the possibility of selecting other search contexts and always force the user to use the current opened view's context.
936
-
937
- ### `facetedSearchEnabled` ![asset-picker-supported] ![asset-manager-supported]
938
-
939
- <u>Type:</u> `boolean`.
940
-
941
- <u>Default:</u> `false`
942
-
943
- Faceted search allows users to filter files using metadata filters. When this feature is enabled:
944
-
945
- - The filters bar will be hidden.
946
- - Only metadata filters with select, select-one, and boolean fields will be displayed.
947
-
948
- _Note_: Faceted search is only active in the assets view.
949
-
950
- ### `facetedSearchSidebarExpanded` ![asset-picker-supported] ![asset-manager-supported]
951
-
952
- <u>Type:</u> `boolean`.
953
-
954
- <u>Default:</u> `true`
955
-
956
- expands faceted search sidebar by default.
957
-
958
- _Note_: if `facetedSearchEnabled` is false, this property will be ignored.
959
-
960
- ### `activeFacetedSearchMetadataFields` ![asset-picker-supported] ![asset-manager-supported]
961
-
962
- <u>Type:</u> `array`.
963
-
964
- <u>Default:</u> `[]`
965
-
966
- Array of metadata fields keys to be shown on faceted search.
967
-
968
- _Note_: only exist filters will be shown.
969
-
970
- ### `filters` ![asset-picker-supported] ![asset-manager-supported]
971
-
972
- <u>Type:</u> `object`.
973
-
974
- <u>Default:</u> `{}`
975
-
976
- Filters to be applied to the views that accept filters, and will be locked if `disableFiltersAndSearch` or `forceFilters` is `true`, consists of the following:
977
-
978
- | Property | Type | Default | Description |
979
- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
980
- | **`date`** | `object` | `{ key: 'created', value: undefined, operator: ':' } ` | the date filter that combines both the option/type and range with the operator |
981
- | **`dateOption`** | `string` \| `integer` | `CREATED === 0` | the date option/type to filter with |
982
- | **`dateRange`** | `integer`(1, 2, 3, 4, 5) \| `string` \| `string['yyyy-mm-dd', 'yyyy-mm-dd']` | `undefined` | The date range used in filtering with the date option |
983
- | **`mimeTypes`** | `string[]` | `undefined` | File mimetypes (in the UI called types) |
984
- | **`fileTypes`** | `string[]` | `undefined` | File types (in the UI called Format) |
985
- | **`size`** | `integers[minMB, maxMB]` | `undefined` | the date option/type to filter with |
986
- | **`tags`** | `string[] ` | `undefined` | The tags that should be contain in the files, the values consist of tag sids without # |
987
- | **`imageOrientations`** | `string[]` | `undefined` | The image orientation values |
988
- | **`imageResolutions`** | `string[]` | `undefined` | The image resolution values |
989
- | **`imageFaces`** | `string[]` | `undefined` | The number of faces found in an image |
990
- | **`imageMainColors`** | `string[]` | `undefined` | The main colors of the image which represents significant proportion in the image |
991
- | **`imageDominantColors`** | `string[]`s | `undefined` | The dominant colors of the image |
992
- | **`metadata`** | `{ key: string, operator: string\|undefined ,value: string\|string[], condition:{ {operator:string ,value: string\|string[]}\| undefined }` | `undefined` | The metadata objects used in filtering |
993
- | **`labels`** | `string[]` | `undefined` | The label sids without # used in filtering files contain that value **(Only 1 label/value is supported currently) -- doesn't work in labels view** |
994
- | **`folders`** | `string[]` | `undefined` | The path of the folders to be used while filtering **(Only 1 folder/value is supported currently) -- doesn't work in folders view** |
995
- | **`licenseExpiry`** | `number[] | string[] | string`\|`string` | `undefined` | The asset license expiry date, possible to be a value of the constant values or custom/specific dates |
996
-
997
- > Note: you could apply the filter value directly as in the following example, or you could add another customer filter operator by providing `operator` property. Ex. { date: { key: 'created', value: ['2022-02-04'], operator: '>' } } // means return the files created after that date.
998
-
999
- > Available filter operators are one of the following: ['>', '<', '<=', '>=', '!=', '=', ':', '~', '~~', '~~~', '~^', '~=']
1000
-
1001
- ```js
1002
- {
1003
- date: {
1004
- key: 'created', // Either a string 'created'/'updated',
1005
- // `value` Either a string 'LAST_DAY'/'LAST_7_DAYS'/'LAST_30_DAYS'/'LAST_90_DAYS'/'LAST_180_DAYS' or integer 1/2/3/4/5 -- constants are preferred -- or for custom range provide an array [from, to] each date in the form yyyy-mm-dd .
1006
- value: ['2024-10-11'],
1007
- // `operator` one of ['>', '<', '<=', '>=', '!=', '=', ':', '~', '~~', '~~~', '~^', '~=']
1008
- operator: '>',
1009
- },
1010
-
1011
- // Not used if `date` is used.
1012
- // `dateOption`: Either a string 'CREATED'/'UPDATED' or integer 0/1.
1013
- dateOption: 0,
1014
-
1015
- // Not used if `date` is used.
1016
- // `dateRange` Either a string 'LAST_DAY'/'LAST_7_DAYS'/'LAST_30_DAYS'/'LAST_90_DAYS'/'LAST_180_DAYS' or integer 1/2/3/4/5 -- constants are preferred -- or for custom range provide an array [from, to] each date in the form yyyy-mm-dd .
1017
- dateRange: 'LAST_7_DAYS',
1018
-
1019
- // `mimeTypes`: An Array of strings, acceptable values any/all of the following ['IMAGE', 'VIDEO', 'AUDIO', 'DOCUMENT', 'ARCHIVE'] or ['image', 'video', 'audio', 'application', 'application/zip, application/x-zip-compressed, application/vnd.rar, application/x-rar-compressed'] -- constants are preferred --.
1020
- mimeTypes: ['IMAGE', 'VIDEO'],
1021
-
1022
- // `fileTypes`: An Array of strings, acceptable values are provided from BE filters API value property found in file type objects, ex. ['img|x-icon', 'img|jpeg'].
1023
- fileTypes: ['img|png', 'img|jpeg'],
1024
-
1025
- // `size`: An Array of integers (only 2), values provided are considered as MB. [minMB, maxMB].
1026
- size: [0, 10],
1027
-
1028
- // `tags`: An Array of strings, values are tag sids coming from BE but without (#).
1029
- tags: ['tge3c9d', 'tgdeaa9'],
1030
-
1031
- // `imageOrientations`: An Array of strings, any/all of the following values are valid ['PORTRAIT', 'PANORAMA', 'SQUARE', 'LANDSCAPE'] or ['portrait', 'panorama', 'square', 'landscape'] -- constants are preferred --.
1032
- imageOrientations: ['PORTRAIT', 'SQUARE'],
1033
-
1034
- // `imageResolutions`: An Array of strings, any/all of the following values are possible ['SMALL', 'MEDIUM', 'LARGE'] or ['small', 'medium', 'large'] -- constants are preferred --.
1035
- imageResolutions: ['MEDIUM', 'LARGE'],
1036
-
1037
- // `imageFaces`: An Array of strings, any/all of the following values are possible ['NO_FACES', 'ONE_FACE', 'TWO_FACES', 'ANY'] or ['0', '1', '2', '*'] -- constants(capitalized) are preferred -- (* => means group/multiple of faces).
1038
- imageFaces: ['1', '*'],
1039
-
1040
- // `imageMainColors`: An Array of strings, represents the color stringy value it must be any/all of the following only no other colors ['PURPLE', 'RED', 'ORANGE', 'PINK', 'GRASS_GREEN', 'YELLOW', 'AZURE', 'CHARTREUSE', 'TEAL'] or ['purple', 'red', 'orange', 'pink', 'grass_green', 'yellow', 'azure', 'chartreuse', 'teal'] -- constants(capitalized) are preferred --.
1041
- imageMainColors: ['TEAL', 'YELLOW'],
1042
-
1043
- // `imageDominantColors`: An Array of strings, represents the color stringy value it must be any/all of the following only no other colors ['PURPLE', 'RED', 'ORANGE', 'PINK', 'GRASS_GREEN', 'YELLOW', 'AZURE', 'CHARTREUSE', 'TEAL'] or ['purple', 'red', 'orange', 'pink', 'grass_green', 'yellow', 'azure', 'chartreuse', 'teal'] -- constants(capitalized) are preferred --.
1044
- imageDominantColors: ['pink', 'red'],
1045
-
1046
- // `metadata`: An Array of objects contains { key, operator, value, condition }, key and value are required for all metadata types, operator is required for single and multiple select metadatas only, condition is required in case operator is 'HAS' to add extra condition (another operator and value) to have metadata working properly, the value either the api_key or the internal unique value, the operators are [IS, NOT, HAS], condition operators are ['AND', 'OR', 'NOT'], all operators must be upper case, also for 'IS' operator we support empty and non empty options to filter all empty/non empty metadata
1047
- metadata: [
1048
- { key: 'cities', value: ['@itm_v1_08bbe7e5_4@', '@itm_v1_905066ed_9@'] },
1049
- { key: 'brand', value: 'adidas' },
1050
- { key: 'color', operator: 'IS', value: 'yellow' },
1051
- { key: 'file', operator: 'HAS', value: 'png', condition: {operator: 'OR', value: 'jpg'} },
1052
- ],
1053
-
1054
- // `labels`: An Array of strings, currently accepts 1 label only and the value should be label sid **with** (#).
1055
- labels: ['#lbbp8dnyu'],
1056
-
1057
- // `folders`: An Array of strings, currently accepts 1 folder path only.
1058
- folders: ['/hello-world'],
1059
-
1060
- // possible values: 'empty' | 'non-empty' | 'specific' (Specific date) | 'range' (Range of 2 dates) | ['', -1] (Before today) | [0] (today) | [1, ''] (After today) | [0, 2] (Within 7 days) | [0, 3] (Within 30 days)
1061
- licenseExpiry: { value: [1, ''], operator: ':' }
1062
- }
1063
- ```
1064
-
1065
- ```js
1066
- // filter with operator syntax example
1067
- {
1068
- [property]: {
1069
- value: '...', // required, depends on the filter its type is provided
1070
- operator: ':' // optional, if needed otherwise the default one is used ':'
1071
- key: '...', // optional, if needed.
1072
- }
1073
- }
1074
- ```
1075
-
1076
- > Note: Constant values are better to be used as they are less prone for changes.
1077
-
1078
- > Note: To lock any of the above properties by using `disabledFiltersAndSearch` or `forceFilters` then you have to provide a value for the property to be locked.
1079
-
1080
- > Note: Operators are allowed to be provided for all the above filters but some of them are not supported on BE.
1081
-
1082
- ### `search` ![asset-picker-supported] ![asset-manager-supported]
1083
-
1084
- <u>Type:</u> `object`.
1085
-
1086
- <u>Default:</u> `{}`
1087
-
1088
- Search object to be considered in the views have searching enabled and will be locked if `disableFiltersAndSearch` is `true`, consists of the following:
1089
-
1090
- | Property | Type | Default | Description |
1091
- | ------------- | ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1092
- | **`query`** | `string` | `undefined` | The search query string shown in the search input and used in searching, if using with `disabledFiltersAndSearch` then the property must contain a stringy value to lock the search or at least empty text `''` |
1093
- | **`tags`** | `string[]` | `undefined` | The search tags found in the search input as advanced search prefxed with symbol (#) -- different from tags of filters -- |
1094
- | **`filters`** | `string[][]` | `undefined` | The advanced search filters found also in search input by prefixing with the symbol (@) the value consists of array of 2 strings array the first string represents the key, second string represents the value and whole array represents an item -- different from filters --. |
1095
-
1096
- ```js
1097
- {
1098
- // `query`: A string search query shown in the search input.
1099
- query: '',
1100
-
1101
- // `tags`: An array of strings **contains** (#). The search input's tags used as advanced search on writing inside the input starting with (#) symbol and spaced tags are surrounded with double quote "" .
1102
- tags: ['#Cairo', '"#Las Vegas"'],
1103
-
1104
- // `filters`: An Array of array consists of 2 strings, the 1st string refers to the filter's key and 2nd refers to the filter's value. The search input's filters used as advanced search on writing inside the input starting with (@) symbol.
1105
- filters: [["key", "value"], ["filename", "Test file"]]
1106
- }
1107
- ```
1108
-
1109
- > Note: To lock any of the above properties by using `disabledFiltersAndSearch` then you have to provide a value for the property to be locked at least empty value would be fine.
1110
-
1111
- ### `disableFiltersAndSearch` ![asset-picker-supported] ![asset-manager-supported]
1112
-
1113
- <u>Type:</u> `boolean`.
1114
-
1115
- <u>Default:</u> `false`
1116
-
1117
- If `true` then the only provided `filters` & `search` objects will be used as filters & search and disable both the filters & search input in UI dis-allowing the user to change/un-select any of them at all keeping the selected/provided filters not disabled but no changes possible for them.
1118
-
1119
- > Note: if search query is empty it won't be disabled if you need to disable it with no text provide an empty string `''`.
1120
-
1121
- > Note: Enabling this option will dismiss applying the filters & search from the url queries.
1122
-
1123
- ### `forceFilters` ![asset-picker-supported] ![asset-manager-supported]
1124
-
1125
- If `true` then the provided `filters` will always get applied with no possibility to remove from the UI, but the user still has the option to extend with more filters from the UI unless the provided filter accepts 1 value only.
1126
-
1127
- > Note: Enabling this option will dismiss applying the filters from the url queries.
1128
-
1129
- ### `disableFileResolutionFallback` ![asset-picker-supported] ![asset-manager-supported]
1130
-
1131
- <u>Type:</u> `boolean`.
1132
-
1133
- <u>Default:</u> `false`
1134
-
1135
- If `true` it will disable fallback request to load resolution info if not found in file details in grid/list layout.
1136
-
1137
- ### `hideLeftSideBar` ![asset-picker-supported] ![asset-manager-supported]
1138
-
1139
- <u>Type:</u> `boolean`.
1140
-
1141
- <u>Default:</u> `false`
1142
-
1143
- Hide the folders tree sidebar and its toggle icon.
1144
-
1145
- ### `defaultFieldKeyOfBulkEditPanel`![uploader-supported] ![asset-manager-supported]
1146
-
1147
- <u>Type:</u> `string`.
1148
-
1149
- <u>Default:</u> `'tags'` fallbacks to `'title'`
1150
-
1151
- Assigns the default field of the bulk edit panel to be opened on showing the bulk edit panel as the focused/default field, it should be one of the general field keys (`tags`/`title`/`description`) or any field key -- lowered case -- of the shown file custom metadata fields (depends on the token).
1152
-
1153
- ### `enableAIDescription` ![asset-manager-supported]
1154
-
1155
- <u>Type:</u> `boolean`.
1156
-
1157
- <u>Default:</u> `false`
1158
-
1159
- Enables the generate description by AI in the description input of file window.
1160
-
1161
- ### `hideVariationsTab` ![asset-manager-supported]
1162
-
1163
- <u>Type:</u> `boolean`.
1164
-
1165
- <u>Default:</u> `false`
1166
-
1167
- If `true` force hides the variations tab in file window panel.
1168
-
1169
- ### `hideMetadataTab` ![asset-manager-supported]
1170
-
1171
- <u>Type:</u> `boolean`.
1172
-
1173
- <u>Default:</u> `false`
1174
-
1175
- If `true` force hides the metadata tab in file window panel.
1176
-
1177
- ## Events
1178
-
1179
- The explorer plugin emits different events that you could subscribe to or add your handler to be called with the provided arguments passed while emitting/firing the event, the events are listed below with examples show the parameters for handler:
1180
-
1181
- ### `objects-removed` ![asset-manager-supported]
1182
-
1183
- Emitted when objects (folders/labels/files) have been removed from the user's side.
1184
-
1185
- `params`:
1186
-
1187
- - `removedObjectsUuids`: An array of removed objects' uuids (for labels the sids will be the value).
1188
- - `removedObjectsType`: `folders`/`labels`/`files`/`items` (files + folders).
1189
-
1190
- example
1191
-
1192
- ```js
1193
- scaleflexWidget.on("objects-removed", (removedObjectsUuids = [], objectsType) => {
1194
- console.log(
1195
- "Objects with the following Uuids have been removed:",
1196
- removedObjectsUuids,
1197
- objectsType
1198
- );
1199
- });
1200
- ```
1201
-
1202
- ### `folders-moved` ![asset-manager-supported]
1203
-
1204
- Emitted when folder(s) are moved from path to another.
1205
-
1206
- `params`:
1207
-
1208
- - `movedFoldersUuids`: An array of folders uuids that are moved.
1209
- - `newPath`: A string of the new path which the folders moved to.
1210
-
1211
- example
1212
-
1213
- ```js
1214
- scaleflexWidget.on('objects-removed', (movedFoldersUuids = [], newPath) => {
1215
- console.log(`Following folders uuids ${movedFoldersUuids.join(,)} are moved to this new path (${newPath}).`)
1216
- })
1217
- ```
1218
-
1219
- <!-- Variables -->
1220
-
1221
- [npm-url]: https://www.npmjs.com/package/@scaleflex/widget-explorer
1222
- [license-url]: https://opensource.org/licenses/MIT
1223
- [sfx-url]: https://www.scaleflex.com/
1224
- [version-url]: https://www.npmjs.com/package/@scaleflex/widget-explorer
1225
- [codeSandbox-url]: https://codesandbox.io/p/sandbox/scalelfex-widget-v4-sandbox-dtp6l3?file=%2Fsrc%2Findex.js
1226
- [npm-image]: https://img.shields.io/npm/v/@telus/remark-config.svg?style=for-the-badge&logo=npm
1227
- [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge
1228
- [made-by-image]: https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg?style=for-the-badge
1229
- [plugins-image]: https://img.shields.io/static/v1?label=Scaleflex&message=Plugins&color=yellow&style=for-the-badge
1230
- [filerobot-image]: https://img.shields.io/static/v1?label=Scaleflex&message=website&color=orange&style=for-the-badge
1231
- [filerobot-version]: https://img.shields.io/npm/v/@scaleflex/widget-explorer?label=Version&style=for-the-badge&logo=npm
1232
- [codeSandbox-image]: https://img.shields.io/badge/CodeSandbox-black?style=for-the-badge&logo=CodeSandbox
1233
- <!-- Supported modes variables -->
1234
- [uploader-supported]: https://img.shields.io/badge/Uploader-orange
1235
- [asset-picker-supported]: https://img.shields.io/badge/Asset%20Picker-green
1
+ # `@scaleflex/widget-explorer`
2
+
3
+ [![Plugins][plugins-image]](#plugins)
4
+ [![Website][filerobot-image]][sfx-url]
5
+ [![Version][filerobot-version]][version-url]
6
+ [![Scaleflex team][made-by-image]][sfx-url]
7
+ [![License][license-image]][license-url]
8
+ [![CodeSandbox][codeSandbox-image]][codeSandbox-url]
9
+
10
+ <div align='center'>
11
+ <img title="Scaleflex Widget logo" alt="Scaleflex Widget logo" src="https://assets.scaleflex.com/Corporate+Branding/%5B2025%5D+ALL+LOGOS+%2B+ICONS/SCALEFLEX/VXP+logo/Horizontal+White/VXP+logo+WHITE.png?vh=663932" width="140"/>
12
+ </div>
13
+
14
+ The file Explorer and media gallery plugin of the [Scaleflex Media Asset Widget](https://www.npmjs.com/package/@scaleflex/widget-core).
15
+
16
+ ## Usage
17
+
18
+ ### NPM
19
+
20
+ ```bash
21
+ npm install --save @scaleflex/widget-explorer
22
+ ```
23
+
24
+ ### YARN
25
+
26
+ ```bash
27
+ yarn add @scaleflex/widget-explorer
28
+ ```
29
+
30
+ then
31
+
32
+ ```js
33
+ import Explorer from '@scaleflex/widget-explorer'
34
+ ...
35
+ ...
36
+ ...
37
+ scaleflexWidget.use(Explorer, propertiesObject)
38
+ ```
39
+
40
+ ### CDN
41
+
42
+ If installed via a [CDN link](../@scaleflex/widget-core#installation), the plugin is inside the `Scaleflex` global object as `Scaleflex.Explorer`
43
+
44
+ ```js
45
+ const Explorer = window.ScaleflexWidget.Explorer
46
+ ...
47
+ ...
48
+ ...
49
+ scaleflexWidget.use(Explorer, propertiesObject)
50
+ ```
51
+
52
+ ### Plugin styles
53
+
54
+ ```js
55
+ import "@scaleflex/widget-core/dist/style.css";
56
+ import "@scaleflex/widget-explorer/dist/style.css";
57
+ ```
58
+
59
+ or via the minified versions
60
+
61
+ ```js
62
+ import "@scaleflex/widget-core/dist/style.min.css";
63
+ import "@scaleflex/widget-explorer/dist/style.min.css";
64
+ ```
65
+
66
+ > The plugin's css file should be imported after the [Core's css file](../@scaleflex/widget-core/#modules-styles) for having the styles shown correctly.
67
+
68
+ ## Explorer modes
69
+
70
+ ### Uploader mode (default mode)
71
+
72
+ The mode used for uploading files using your chosen/configured uploading provider to your token and chosen path.
73
+
74
+ #### how to?
75
+
76
+ Just initialize the widget normally and keep [`ExploreViewComponent`](#exploreviewcomponent) property in Explorer plugin with a null/empty value.
77
+
78
+ ```js
79
+ // ScaleflexWidget.Core initializations
80
+ scaleflexWidget.use(Explorer, {
81
+ // ...otherParams,
82
+ ExploreViewComponent: null
83
+ })
84
+ scaleflexWidget.use(XHRUpload, {
85
+ uploadToFolderPath: '/test'
86
+ })
87
+ ```
88
+
89
+ ### Browser/Light-DAM mode
90
+
91
+ The mode used for browsing files/folders using the Explorer's main view and do some light-weight/quick functionalities like reading & writing files metadata in addition to uploading files.
92
+
93
+ #### how to?
94
+
95
+ Initialize the plugin with providing the component `@scaleflex/widget-explorer/lib/components/ExploreView` to the [`ExploreViewComponent`](#exploreviewcomponent) property.
96
+
97
+ ```js
98
+ import ExploreView from '@scaleflex/widget-explorer/lib/components/ExploreView'
99
+ // ...scaleflexWidget and other plugins initializations
100
+
101
+ scaleflexWidget.use(Explorer, {
102
+ // ...otherParams,
103
+ ExploreViewComponent: ExploreView
104
+ })
105
+ ```
106
+
107
+ ### Assets picker mode
108
+
109
+ Enabling the ability to browse the files/folders and preview them with and their metadata. Select files from the current token and do your own custom functionality after selecting the files.
110
+
111
+ #### how to?
112
+
113
+ 1. Initialize the plugin and provide the component `@scaleflex/widget-explorer/lib/components/ExploreView` to the [`ExploreViewComponent`](#exploreviewcomponent) property.
114
+ 2. provide `useAssetsPicker` property with a `true` value.
115
+
116
+ ```js
117
+ import ExploreView from '@scaleflex/widget-explorer/lib/components/ExploreView'
118
+ // ...scaleflexWidget and other plugins initializations
119
+
120
+ scaleflexWidget.use(Explorer, {
121
+ // ...otherParams,
122
+ ExploreViewComponent: ExploreView,
123
+ useAssetsPicker: true,
124
+ hideDownloadButtonIcon: true
125
+ })
126
+ ```
127
+
128
+ > Note: please check the plugin's properties in-case you want to customize anything else related to any of the mentioned 3 modes above (some of the properties might work only for specific mode).
129
+
130
+ ## Properties
131
+
132
+ The Explorer supports multiple properties to customize the plugin according to your needs. Required attributes are marked with **_(Required)_**.
133
+
134
+
135
+ ### `locale` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
136
+
137
+ <u>Type:</u> `object`.
138
+
139
+ <u>Default:</u> locales from scaleflexWidget's backend then default locale file with all labels is under `lib/defaultLocale.js`.
140
+
141
+ You can override some labels by specifying a translation object here, such as:
142
+
143
+ ```js
144
+ {
145
+ strings: {
146
+ baseFolderTitle: "Root"; // overrides the default Home value to Root
147
+ }
148
+ }
149
+ ```
150
+
151
+ ### `config` ![asset-picker-supported] ![asset-manager-supported]
152
+
153
+ <u>Type:</u> `object`
154
+
155
+ <u>Default:</u>
156
+
157
+ ```js
158
+ {
159
+ config: {
160
+ foldersLimit: 200,
161
+ filesLimit: 50,
162
+ rootFolderPath: '/',
163
+ defaultSort: {
164
+ by: '',
165
+ order: ''
166
+ },
167
+ tagging: {...} // check tagging section
168
+ }
169
+ }
170
+ ```
171
+
172
+ The config objects contains the main configuration for the plugin to interact with your Scaleflex project:
173
+
174
+ #### `foldersLimit` ![asset-picker-supported] ![asset-manager-supported]
175
+
176
+ <u>Type:</u> `number`.
177
+
178
+ <u>Default:</u> `200`
179
+
180
+ Number of folders to be retrieved with folders initial request.
181
+
182
+ #### `maxCountOfSelectedFiles` ![asset-picker-supported] ![asset-manager-supported]
183
+
184
+ <u>Type:</u> `number`.
185
+
186
+ <u>Default:</u> `undefined`
187
+
188
+ Maximum number of files that can be selected.
189
+
190
+ #### `filesLimit` ![asset-picker-supported] ![asset-manager-supported]
191
+
192
+ <u>Type:</u> `number`.
193
+
194
+ <u>Default:</u> `50`
195
+
196
+ Number of files to be retrieved with files initial request.
197
+
198
+ #### `rootFolderPath` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
199
+
200
+ <u>Type:</u> `string`.
201
+
202
+ <u>Default:</u> `/`
203
+
204
+ Overrides the root folder path when there is no `list scope` linked with the [securityTemplateId](..@scaleflex/widget-core/README.md/#securitytemplateid) or at least 2 folders or more in the `list scope` otherwise it has no effect.
205
+
206
+ > Note: If the [securityTemplateId](..@scaleflex/widget-core/README.md/#securitytemplateid) has 2 folders at least, then the provided folder path must be one of these folders or one of their sub-folders.
207
+
208
+ #### `defaultSort` ![asset-picker-supported] ![asset-manager-supported]
209
+
210
+ <u>Type:</u> `object`.
211
+
212
+ <u>Default:</u> `{ by: 'name', order: 'asc' }`
213
+
214
+ Customize the default selected sort option for both files & folders shown in the main view (not applicable for folders tree or objects' trees) applied for all the files shown regardless of the opened view.
215
+
216
+ The options available sorting
217
+
218
+ | Property | Type | Default | Description |
219
+ | ----------- | -------- | ------- | --------------------------------------------------------------------------------------------------------- |
220
+ | **`by`** | `string` | `name` | Defines the default sort by param, should be one of ['name', 'created_at', 'modified_at', 'size', 'type'] |
221
+ | **`order`** | `string` | `asc` | Defines the default sort order param, should be one of ['asc', 'desc'] |
222
+
223
+ > Note: its value is considered only on plugin's install/mount.
224
+
225
+ #### `defaultSearchSort` ![asset-picker-supported] ![asset-manager-supported]
226
+
227
+ <u>Type:</u> `object`.
228
+
229
+ <u>Default:</u>
230
+
231
+ ```js
232
+ {
233
+ text: {
234
+ by: 'name',
235
+ order: 'asc'
236
+ }
237
+ }
238
+ ```
239
+
240
+ Customize the default selected sort option for search shown in the main view, applied for all the files shown regardless of the opened view.
241
+
242
+ The options available sorting
243
+
244
+ | Property | Type | Default | Description |
245
+ | ---------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
246
+ | **text.`by`** | `string` | `name` | Defines the default search sort by param, should be one of ['relevance', 'name', 'created_at', 'modified_at', 'size', 'type'] |
247
+ | **text.`order`** | `string` | `asc` | Defines the default search sort order param, should be one of ['asc', 'desc'] |
248
+
249
+ #### `tagging` ![asset-manager-supported]
250
+
251
+ <u>Type:</u> `object`.
252
+
253
+ <u>Default:</u>
254
+
255
+ ```js
256
+ {
257
+ tagging: {
258
+ enabled: false,
259
+ autoTagging: false,
260
+ suggestedTagsOnly: false,
261
+ language: 'en',
262
+ confidence: 60,
263
+ limit: 10,
264
+ provider: 'google',
265
+ suggestionList: []
266
+ }
267
+ }
268
+ ```
269
+
270
+ The options available for tagging
271
+
272
+ | Property | Type | Default | Description |
273
+ | ----------------------- | ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
274
+ | **`enabled`** | `boolean` | `false` | Enable/disable tags |
275
+ | **`autoTagging`** | `boolean` | `false` | Enable/disable auto-tagging |
276
+ | **`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. |
277
+ | **`language`** | `string` | `en` | AutoTagging config that we add in POST process/autoTag request data.meta |
278
+ | **`confidence`** | `number` | `60` | AutoTagging config that we add in POST process/autoTag request data.meta |
279
+ | **`limit`** | `number` | `10` | AutoTagging config that we add in POST process/autoTag request data.meta |
280
+ | **`provider`** | `string` | `[]` | AutoTagging config that we add in POST process/autoTag request data.meta |
281
+ | **`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: |
282
+
283
+ ```js
284
+ {
285
+ sid: string, // Short id like: '#tg1885f'
286
+ names: {
287
+ en: string,
288
+ fr: string
289
+ },
290
+ primary: boolean // If true, tag will be shown in Suggestions list below tags field
291
+ }
292
+ ```
293
+
294
+ ### `inline` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
295
+
296
+ <u>Type:</u> `boolean`.
297
+
298
+ <u>Default:</u> `false`
299
+
300
+ If set to `true`, the plugin will be displayed as inline element in the element referred by the [target](#target) property. Otherwise, it will pop up in a modal upon [trigger](#trigger), see below.
301
+
302
+ ### `trigger` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
303
+
304
+ <u>Type:</u> `string`.
305
+
306
+ <u>Default:</u> `null`
307
+
308
+ The selector used for triggering the display of the plugin modal, if passed to `querySelectorAll` function. Available options:
309
+
310
+ - HTML tag, eg. `body`
311
+ - CSS selector, eg. `#scaleflex-widget-trigger-button` or `.scaleflex-widget-trigger-button`
312
+
313
+ Multiple triggers are supported as click events.
314
+
315
+ > **_Required if_** [inline](#inline): false
316
+
317
+ ### `target` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
318
+
319
+ <u>Type:</u> `string`.
320
+
321
+ <u>Default:</u> ``
322
+
323
+ The selector used for displaying the plugin, if passed to `querySelector` function. Options:
324
+
325
+ - HTML tag, eg. `body`
326
+ - CSS selector, eg. `#scaleflex-widget-container` or `.scaleflex-widget-container`
327
+
328
+ > **_Required if_** [inline](#inline): false
329
+
330
+ ### `width` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
331
+
332
+ <u>Type:</u> `number`| `string`.
333
+
334
+ <u>Default:</u> `768`
335
+
336
+ Width of the plugin as a number if specified in pixels or a percentage, eg. `'50%'`
337
+
338
+ ### `height` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
339
+
340
+ <u>Type:</u> `number`| `string`.
341
+
342
+ <u>Default:</u> `538`
343
+
344
+ Height of the plugin as a number if specified in `px` or a percentage eg. `'35%'`
345
+
346
+ ### `thumbnailWidth` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
347
+
348
+ <u>Type:</u> `number`.
349
+
350
+ <u>Default:</u> `280`
351
+
352
+ Pixel width of the asset thumbnails displayed in the uploads panel. Apect ratio of images is kept in case of image assets.
353
+
354
+ ### `thumbnailHeight` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
355
+
356
+ <u>Type:</u> `number`.
357
+
358
+ <u>Default:</u> `170`
359
+
360
+ Pixel height of the asset thumbnails displayed in the uploads panel. Aspect ratio of images is kept in case of image assets.
361
+
362
+ ### `ExploreViewComponent` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
363
+
364
+ <u>Type:</u> `ReactComponent`.
365
+
366
+ <u>Default:</u> `null`
367
+
368
+ <u>Expected value:</u> `@scaleflex/widget-explorer/lib/components/ExploreView`
369
+
370
+ The view component that is responsible about showing the objects (folders/files...etc.) with the possibility to browse them and enable other functionalities.
371
+
372
+ ### `mutedFilesUuids` ![asset-picker-supported] ![asset-manager-supported]
373
+
374
+ <u>Type:</u> `array`.
375
+
376
+ <u>Default:</u> `[]`
377
+
378
+ List of file UUIDs with the state "muted". These files cannot be selected or have any actions performed on them.
379
+
380
+ ### `views` ![asset-picker-supported] ![asset-manager-supported]
381
+
382
+ <u>Type:</u> `array`.
383
+
384
+ <u>Default:</u> `['ASSETS', 'FOLDERS']`
385
+
386
+ List of available views.
387
+
388
+ > **NOTE** some views can be hidden if you don't have permission provided in [securityTemplateId](..@scaleflex/widget-core/README.md/#securitytemplateid).
389
+
390
+ ### `view` ![asset-picker-supported] ![asset-manager-supported]
391
+
392
+ <u>Type:</u> `string`.
393
+
394
+ <u>Default:</u> `'FOLDERS'`
395
+
396
+ View which will be currently opened.
397
+
398
+ ### `viewItem` ![asset-picker-supported] ![asset-manager-supported]
399
+
400
+ <u>Type:</u> `string`.
401
+
402
+ <u>Default:</u> `null`
403
+
404
+ Open the provided view's item/object for ex. (folders view => folder path, labels view => label sid or uuid ...etc.)
405
+
406
+ > Note: No auto redirect to the view, you have to provide the proper view from [`view prop`](#view).
407
+
408
+ ### `viewSubItem` ![asset-picker-supported] ![asset-manager-supported]
409
+
410
+ <u>Type:</u> `string`.
411
+
412
+ <u>Default:</u> `null`
413
+
414
+ A sub item that should be opened inside the provided [`view`](#view) & [`viewItem`](#viewitem).
415
+
416
+ > Note: No auto redirect to the view, you have to provide the proper view from [`view prop`](#view).
417
+
418
+ ### `layoutType` ![asset-picker-supported] ![asset-manager-supported]
419
+
420
+ <u>Type:</u> `boolean`.
421
+
422
+ <u>Default:</u> `grid`
423
+
424
+ Specifies the default layout in the view:
425
+
426
+ | Value | Description |
427
+ | ---------- | ------------------------------------------- |
428
+ | **`grid`** | shows folders/assets as cards in a grid |
429
+ | **`list`** | shows the folders/assets as rows in a table |
430
+
431
+ you can switch between layouts from the layout selector button in the right side in header bar.
432
+
433
+ ### `waitForThumbnailsBeforeUpload` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
434
+
435
+ <u>Type:</u> `boolean`.
436
+
437
+ <u>Default:</u> `false`
438
+
439
+ If set to `true`, delays the start of the upload process until the asset thumbnails are generated and displayed in the plugin.
440
+
441
+ ### `showBar` ![asset-picker-supported] ![asset-manager-supported]
442
+
443
+ <u>Type:</u> `boolean`.
444
+
445
+ <u>Default:</u> `true`
446
+
447
+ If set to `false`, hides the top bar with **Upload** button, searchBar, create folder button and view button.
448
+
449
+ ### `showImportFromDamButton` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
450
+
451
+ <u>Type:</u> `boolean`.
452
+
453
+ <u>Default:</u> `false`
454
+
455
+ If set to `true`, shows the **Import from DAM** button in the uploads panel to upload from DAM.
456
+
457
+ > Note: this property requires `ExploreViewComponent` to be provided to be able to browse the objects.
458
+
459
+ ### `disableUpload` ![asset-picker-supported] ![asset-manager-supported]
460
+
461
+ <u>Type:</u> `boolean`.
462
+
463
+ <u>Default:</u> `false`
464
+
465
+ If set to `true`, hides the **Upload** button at the top of the plugin.
466
+
467
+ ### `hideSearch` ![asset-picker-supported] ![asset-manager-supported]
468
+
469
+ <u>Type:</u> `boolean`.
470
+
471
+ <u>Default:</u> `false`
472
+
473
+ Hides **Search** field at the top of the plugin.
474
+
475
+ ### `note` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
476
+
477
+ <u>Type:</u> `string`.
478
+
479
+ <u>Default:</u> `null`
480
+
481
+ A custom note displayed in the upload screen for drag&drop.
482
+
483
+ ### `hint` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
484
+
485
+ <u>Type:</u> `string`.
486
+
487
+ <u>Default:</u> `null`
488
+
489
+ A custom hint displayed in the upload screen at the bottom.
490
+
491
+ ### `closeModalOnClickOutside` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
492
+
493
+ <u>Type:</u> `boolean`.
494
+
495
+ <u>Default:</u> `false`
496
+
497
+ Plugin modal will be closed when clicking outside of the modal.
498
+
499
+ > **_Only relevant if_** [inline](#inline): false
500
+
501
+ ### `preventModalOverlayClickOnUpload` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
502
+
503
+ <u>Type:</u> `boolean`.
504
+
505
+ <u>Default:</u> `false`
506
+
507
+ Plugin modal still opened when click outside of it, if there's selected files to be uploaded
508
+
509
+ > **_Only relevant if_** [closeModalOnClickOutside](#closeModalOnClickOutside): true
510
+
511
+ ### `closeAfterFinish` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
512
+
513
+ <u>Type:</u> `boolean`.
514
+
515
+ <u>Default:</u> `false`
516
+
517
+ Modal will close after upload is finished.
518
+
519
+ > **_Only relevant if_** [inline](#inline): false
520
+
521
+ ### `closeAfterUploadStart` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
522
+
523
+ <u>Type:</u> `boolean`.
524
+
525
+ <u>Default:</u> `false`
526
+
527
+ Modal will close after upload is started.
528
+
529
+ > **_Only relevant if_** [inline](#inline): false
530
+
531
+ ### `onClickUploadButton` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
532
+
533
+ <u>Type:</u> `function`.
534
+
535
+ <u>Default:</u> `() => {}`
536
+
537
+ A callback function that would be triggered when the user clicks on upload button that is shown in the uploads panel, if returned `true` then the default upload functionality won't be triggered.
538
+
539
+ ### `disableInformer` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
540
+
541
+ <u>Type:</u> `boolean`.
542
+
543
+ <u>Default:</u> `false`
544
+
545
+ Disables the [informer](../@scaleflex/widget-informer/#scaleflexwidget-informer) plugin used to show warnings and errors.
546
+
547
+ ### `disableThumbnailGenerator` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
548
+
549
+ <u>Type:</u> `boolean`.
550
+
551
+ <u>Default:</u> `false`
552
+
553
+ Disables the [thumbnail-generator](../@scaleflex/widget-thumbnail-generator/#scaleflexwidget-thumbnail-generator) plugin that generates image thumbnails.
554
+
555
+ ### `disablePageScrollWhenModalOpen` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
556
+
557
+ <u>Type:</u> `boolean`.
558
+
559
+ <u>Default:</u> `true`
560
+
561
+ If set to `true`, disables scrolling for the document while the plugin modal is open.
562
+
563
+ > **_Only relevant if_** [inline](#inline): false
564
+
565
+ ### `disableDownloadButton` ![asset-picker-supported] ![asset-manager-supported]
566
+
567
+ <u>Type:</u> `boolean`.
568
+
569
+ <u>Default:</u> `false`
570
+
571
+ Hides the download button shown in the action bar when selecting files.
572
+
573
+ ### `preventDownloadDefaultBehavior` ![asset-picker-supported] ![asset-manager-supported]
574
+
575
+ <u>Type:</u> `boolean`.
576
+
577
+ <u>Default:</u> `false`
578
+
579
+ Prevent default behavior of download/export.
580
+
581
+ ### `hideDownloadVariationsOption` ![asset-picker-supported] ![asset-manager-supported]
582
+
583
+ <u>Type:</u> `boolean`.
584
+
585
+ <u>Default:</u> `false`
586
+
587
+ Hide transformation in download options in context menu and action bar.
588
+
589
+ ### `hideDownloadButtonIcon` ![asset-picker-supported] ![asset-manager-supported]
590
+
591
+ <u>Type:</u> `boolean`.
592
+
593
+ <u>Default:</u> `false`
594
+
595
+ Hides the download/export button icon.
596
+
597
+ ### `hideHeaderBar` ![asset-picker-supported] ![asset-manager-supported]
598
+
599
+ <u>Type:</u> `boolean`.
600
+
601
+ <u>Default:</u> `false`
602
+
603
+ Hides the header bar, header bar contains breadcrumbs and other action buttons.
604
+
605
+ ### `hideExportCropPanel` ![asset-picker-supported] ![asset-manager-supported]
606
+
607
+ <u>Type:</u> `boolean`.
608
+
609
+ <u>Default:</u> `false`
610
+
611
+ The crop button in the export options modal will be hidden.
612
+
613
+ ### `forceDownload` ![asset-picker-supported] ![asset-manager-supported]
614
+
615
+ <u>Type:</u> `boolean`.
616
+
617
+ <u>Default:</u> `false`
618
+
619
+ Adds `download=1` param to the CDN download link
620
+
621
+ ### `imageEditorMode` ![asset-manager-supported]
622
+
623
+ <u>Type:</u> `string`.
624
+
625
+ <u>Default:</u> `'default'`
626
+
627
+ Possible values: `'default' | 'cloudimage' `
628
+
629
+ Set imageEditorMode for the image editor plugin.
630
+
631
+ ### `hideModalAfterExport` ![asset-picker-supported] ![asset-manager-supported]
632
+
633
+ <u>Type:</u> `boolean`.
634
+
635
+ <u>Default:</u> `false`
636
+
637
+ Hides the modal after finish download/export.
638
+
639
+ ### `closeAfterImageEdit` ![asset-manager-supported]
640
+
641
+ <u>Type:</u> `boolean`.
642
+
643
+ <u>Default:</u> `false`
644
+
645
+ Hides the modal after finish editing image.
646
+
647
+ ### `onRequestCloseModal` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
648
+
649
+ <u>Type:</u> `() => undefined`.
650
+
651
+ <u>Default:</u> `closeModal` function
652
+
653
+ Specified a custom function to be executed when trying to close the modal. Default closing modal behavior is overridden
654
+
655
+ > **_Only relevant if_** [inline](#inline): false
656
+
657
+ ### `animateOpenClose` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
658
+
659
+ <u>Type:</u> `boolean`.
660
+
661
+ <u>Default:</u> `true`
662
+
663
+ Disable the modal's opening and closing.
664
+
665
+ > **_Only relevant if_** [inline](#inline): false
666
+
667
+ ### `browserBackButtonCloseModal` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
668
+
669
+ <u>Type:</u> `boolean`.
670
+
671
+ <u>Default:</u> `false`
672
+
673
+ The browser **Back** button will close the modal, otherwise it will trigger the standard back browser behavior.
674
+
675
+ > **_Only relevant if_** [inline](#inline): false
676
+
677
+ ### `enableFoldersStatsApiRequest` ![asset-picker-supported] ![asset-manager-supported]
678
+
679
+ <u>Type:</u> `boolean`.
680
+
681
+ <u>Default:</u> `false`
682
+
683
+ When enabled it will send extra folders/stats API request with the folders request to get folders count.
684
+
685
+ ### `isUploadBarAddMoreButtonHidden` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
686
+
687
+ <u>Type:</u> `boolean`.
688
+
689
+ <u>Default:</u> `false`
690
+
691
+ The 'Add More' button in upload module is hidden preventing users to upload more item.
692
+
693
+ ### `showFoldersTree` ![asset-picker-supported] ![asset-manager-supported]
694
+
695
+ <u>Type:</u> `boolean`.
696
+
697
+ <u>Default:</u> `false`
698
+
699
+ 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.
700
+
701
+ > **_Only relevant if_** folders view is provided in [views](#views)
702
+
703
+ ### `showDetailsView` ![asset-picker-supported] ![asset-manager-supported]
704
+
705
+ <u>Type:</u> `boolean`.
706
+
707
+ <u>Default:</u> `false`
708
+
709
+ 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.
710
+
711
+ ### `hideDetailsViewButton` ![asset-picker-supported] ![asset-manager-supported]
712
+
713
+ <u>Type:</u> `boolean`.
714
+
715
+ <u>Default:</u> `false`
716
+
717
+ Hides the asset details view button from the info icon in the right side of the breadcrumbs.
718
+
719
+ ### `videoTranscoding` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
720
+
721
+ <u>Type:</u> `object`.
722
+
723
+ <u>Default:</u>
724
+
725
+ ```js
726
+ {
727
+ resolution: 'auto',
728
+ protocol: 'HLS'
729
+ }
730
+ ```
731
+
732
+ Video transcoding options for post-upload video transcoding:
733
+
734
+ | Property | Type | Default | Description |
735
+ | ---------------- | ------------------- | ------- | ---------------------------------------- |
736
+ | **`resolution`** | `string` _required_ | `auto` | target resolutions for video transcoding |
737
+ | **`protocol`** | `string` _required_ | `HLS` | which protocol to use while transcoding |
738
+
739
+ ### `cropPresets` ![asset-picker-supported] ![asset-manager-supported]
740
+
741
+ <u>Type:</u> `object`.
742
+
743
+ <u>Default:</u> `{}`
744
+
745
+ Defines additional crop types & presets besides the freehand one and their presets and its shape as follows
746
+
747
+ ```js
748
+ {
749
+ 'Social media': [
750
+ /**
751
+ * label: possible to be a string or string in form of i18n key provided through locale object
752
+ * 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.
753
+ */
754
+ { label: 'Facebook profile', value: '400:400:true' },
755
+ { label: 'linkedInCover', value: '1128:191:false' }
756
+ ],
757
+ custom: [
758
+ { label: 'logoSize', value: '320:100' }
759
+ ],
760
+ ellipse: {
761
+ label: 'ellipse', value: 'ellipse'
762
+ },
763
+ original: {
764
+ label: 'original', value: 'original'
765
+ }
766
+ }
767
+ ```
768
+
769
+ > NOTE: The 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)
770
+
771
+ ### `disableMultipleSelect` ![asset-picker-supported] ![asset-manager-supported]
772
+
773
+ <u>Type:</u> `boolean`.
774
+
775
+ <u>Default:</u> `false`
776
+
777
+ Multiple files/folders selections will be disabled and only 1 file/folder possible to be selected.
778
+
779
+ ### `dismissUrlPathQueryUpdate` ![asset-picker-supported] ![asset-manager-supported]
780
+
781
+ <u>Type:</u> `boolean`.
782
+
783
+ <u>Default:</u> `false`
784
+
785
+ The url query `fmaw_path` won't be added/updated to the current url.
786
+
787
+ ### `showScaleflexCopyright` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
788
+
789
+ <u>Type:</u> `boolean`.
790
+
791
+ <u>Default:</u> `false`
792
+
793
+ Hides Scaleflex copyright at the bottom of the plugin.
794
+
795
+ ### `useAssetsPicker` ![asset-picker-supported]
796
+
797
+ <u>Type:</u> `boolean`.
798
+
799
+ <u>Default:</u> `false`
800
+
801
+ If set to `true`, actions like deleting, editing, or downloading assets will not be allowed, explore and insert actions allowed.
802
+
803
+ ### `assetsPickerModelTitle` ![asset-picker-supported]
804
+
805
+ <u>Type:</u> `string`.
806
+
807
+ <u>Default:</u> `explorerTopSectionImportFileTitle`
808
+
809
+ changing it's value changes the asset picker's model title
810
+
811
+ ### `disableFolderSelection` ![asset-manager-supported]
812
+
813
+ <u>Type:</u> `boolean`.
814
+
815
+ <u>Default:</u> `false`
816
+
817
+ If set to `true`, disable the possiblity to select folder(s).
818
+
819
+ ### `hideFolderOptions` ![asset-manager-supported]
820
+
821
+ <u>Type:</u> `boolean`.
822
+
823
+ <u>Default:</u> `false`
824
+
825
+ If set to `true`, hide the folder item top options.
826
+
827
+ ### `hideDetailsSidebarButton` ![asset-picker-supported] ![asset-manager-supported]
828
+
829
+ <u>Type:</u> `boolean`.
830
+
831
+ <u>Default:</u> `false`
832
+
833
+ If set to `true`, hide toggle details sidebar button.
834
+
835
+ ### `hideActionBarSelectionButtons` ![asset-picker-supported] ![asset-manager-supported]
836
+
837
+ <u>Type:</u> `boolean`.
838
+
839
+ <u>Default:</u> `false`
840
+
841
+ If set to `true`, hide the selection buttons in the action bar.
842
+
843
+ ### `disableDnDActions` ![asset-picker-supported] ![asset-manager-supported]
844
+
845
+ <u>Type:</u> `boolean`.
846
+
847
+ <u>Default:</u> `false`
848
+
849
+ If set to `true`, disable the drag and drop actions to move assets/folders or upload
850
+
851
+ ### `noImgOperationsAndDownload` ![asset-picker-supported] ![asset-manager-supported]
852
+
853
+ <u>Type:</u> `boolean`.
854
+
855
+ <u>Default:</u> `false`
856
+
857
+ If set to `true`, hides some options in asset contextual menu:
858
+
859
+ - Download (context menu)
860
+ - Transformation (action bar)
861
+ - Edit image (context menu and action bar)
862
+
863
+ ### `queryParamPrefix` ![asset-picker-supported] ![asset-manager-supported]
864
+
865
+ <u>Type:</u> `string`.
866
+
867
+ <u>Default:</u> `fmaw_`
868
+
869
+ Override the query params
870
+
871
+ ### `showDragDropPanel` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
872
+
873
+ <u>Type:</u> `boolean`.
874
+
875
+ <u>Default:</u> `false`
876
+
877
+ Changes the design for the addFiles panel in uploads.
878
+
879
+ ### `showSort` ![asset-picker-supported] ![asset-manager-supported]
880
+
881
+ <u>Type:</u> `boolean`.
882
+
883
+ <u>Default:</u> `true`
884
+
885
+ shows/hides sort button in Explorer.
886
+
887
+ ### `isDownloadUsageRightsEnabled` ![asset-picker-supported] ![asset-manager-supported]
888
+
889
+ <u>Type:</u> `boolean`.
890
+
891
+ <u>Default:</u> `false`
892
+
893
+ Enables/disables the download of usage rights file with assets.
894
+
895
+ ### `useLoginMode` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
896
+
897
+ <u>Type:</u> `boolean`.
898
+
899
+ <u>Default:</u> `false`
900
+
901
+ Enables/disables the login mode which gives the user the possibility to login by his credentials (email & password) through a form shown to the user while using the widget, respecting the provided `container` in the core class of the widget.
902
+
903
+ > Note: Don't provide security template key nor sass key if you need to use enable this feature by providing its value to `true`.
904
+
905
+ ### `prefilledLoginModeEmail` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
906
+
907
+ <u>Type:</u> `string`.
908
+
909
+ <u>Default:</u> `null`
910
+
911
+ The property used to add a default email address in the email address field of the login mode form, if not provided the email address will be empty. In both cases, the user will be able to change/add his email address and this property is used by having [`useLoginMode`](#useloginmode) enabled.
912
+
913
+ ### `hideAddingComment` ![asset-manager-supported]
914
+
915
+ <u>Type:</u> `boolean`.
916
+
917
+ <u>Default:</u> `false`
918
+
919
+ Removes the add comment textarea from the comments tab.
920
+
921
+ ### `findAssetLocationEnabled` ![asset-manager-supported]
922
+
923
+ <u>Type:</u> `boolean`.
924
+
925
+ <u>Default:</u> `true`
926
+
927
+ Providing `false`, will hide `Open asset location` option in the context menu and file window.
928
+
929
+ ### `restrictedSearchContext` ![asset-picker-supported] ![asset-manager-supported]
930
+
931
+ <u>Type:</u> `boolean`.
932
+
933
+ <u>Default:</u> `false`
934
+
935
+ Providing `true`, will disable the possibility of selecting other search contexts and always force the user to use the current opened view's context.
936
+
937
+ ### `facetedSearchEnabled` ![asset-picker-supported] ![asset-manager-supported]
938
+
939
+ <u>Type:</u> `boolean`.
940
+
941
+ <u>Default:</u> `false`
942
+
943
+ Faceted search allows users to filter files using metadata filters. When this feature is enabled:
944
+
945
+ - The filters bar will be hidden.
946
+ - Only metadata filters with select, select-one, and boolean fields will be displayed.
947
+
948
+ _Note_: Faceted search is only active in the assets view.
949
+
950
+ ### `facetedSearchSidebarExpanded` ![asset-picker-supported] ![asset-manager-supported]
951
+
952
+ <u>Type:</u> `boolean`.
953
+
954
+ <u>Default:</u> `true`
955
+
956
+ expands faceted search sidebar by default.
957
+
958
+ _Note_: if `facetedSearchEnabled` is false, this property will be ignored.
959
+
960
+ ### `activeFacetedSearchMetadataFields` ![asset-picker-supported] ![asset-manager-supported]
961
+
962
+ <u>Type:</u> `array`.
963
+
964
+ <u>Default:</u> `[]`
965
+
966
+ Array of metadata fields keys to be shown on faceted search.
967
+
968
+ _Note_: only exist filters will be shown.
969
+
970
+ ### `filters` ![asset-picker-supported] ![asset-manager-supported]
971
+
972
+ <u>Type:</u> `object`.
973
+
974
+ <u>Default:</u> `{}`
975
+
976
+ Filters to be applied to the views that accept filters, and will be locked if `disableFiltersAndSearch` or `forceFilters` is `true`, consists of the following:
977
+
978
+ | Property | Type | Default | Description |
979
+ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
980
+ | **`date`** | `object` | `{ key: 'created', value: undefined, operator: ':' } ` | the date filter that combines both the option/type and range with the operator |
981
+ | **`dateOption`** | `string` \| `integer` | `CREATED === 0` | the date option/type to filter with |
982
+ | **`dateRange`** | `integer`(1, 2, 3, 4, 5) \| `string` \| `string['yyyy-mm-dd', 'yyyy-mm-dd']` | `undefined` | The date range used in filtering with the date option |
983
+ | **`mimeTypes`** | `string[]` | `undefined` | File mimetypes (in the UI called types) |
984
+ | **`fileTypes`** | `string[]` | `undefined` | File types (in the UI called Format) |
985
+ | **`size`** | `integers[minMB, maxMB]` | `undefined` | the date option/type to filter with |
986
+ | **`tags`** | `string[] ` | `undefined` | The tags that should be contain in the files, the values consist of tag sids without # |
987
+ | **`imageOrientations`** | `string[]` | `undefined` | The image orientation values |
988
+ | **`imageResolutions`** | `string[]` | `undefined` | The image resolution values |
989
+ | **`imageFaces`** | `string[]` | `undefined` | The number of faces found in an image |
990
+ | **`imageMainColors`** | `string[]` | `undefined` | The main colors of the image which represents significant proportion in the image |
991
+ | **`imageDominantColors`** | `string[]`s | `undefined` | The dominant colors of the image |
992
+ | **`metadata`** | `{ key: string, operator: string\|undefined ,value: string\|string[], condition:{ {operator:string ,value: string\|string[]}\| undefined }` | `undefined` | The metadata objects used in filtering |
993
+ | **`labels`** | `string[]` | `undefined` | The label sids without # used in filtering files contain that value **(Only 1 label/value is supported currently) -- doesn't work in labels view** |
994
+ | **`folders`** | `string[]` | `undefined` | The path of the folders to be used while filtering **(Only 1 folder/value is supported currently) -- doesn't work in folders view** |
995
+ | **`licenseExpiry`** | `number[] | string[] | string`\|`string` | `undefined` | The asset license expiry date, possible to be a value of the constant values or custom/specific dates |
996
+
997
+ > Note: you could apply the filter value directly as in the following example, or you could add another customer filter operator by providing `operator` property. Ex. { date: { key: 'created', value: ['2022-02-04'], operator: '>' } } // means return the files created after that date.
998
+
999
+ > Available filter operators are one of the following: ['>', '<', '<=', '>=', '!=', '=', ':', '~', '~~', '~~~', '~^', '~=']
1000
+
1001
+ ```js
1002
+ {
1003
+ date: {
1004
+ key: 'created', // Either a string 'created'/'updated',
1005
+ // `value` Either a string 'LAST_DAY'/'LAST_7_DAYS'/'LAST_30_DAYS'/'LAST_90_DAYS'/'LAST_180_DAYS' or integer 1/2/3/4/5 -- constants are preferred -- or for custom range provide an array [from, to] each date in the form yyyy-mm-dd .
1006
+ value: ['2024-10-11'],
1007
+ // `operator` one of ['>', '<', '<=', '>=', '!=', '=', ':', '~', '~~', '~~~', '~^', '~=']
1008
+ operator: '>',
1009
+ },
1010
+
1011
+ // Not used if `date` is used.
1012
+ // `dateOption`: Either a string 'CREATED'/'UPDATED' or integer 0/1.
1013
+ dateOption: 0,
1014
+
1015
+ // Not used if `date` is used.
1016
+ // `dateRange` Either a string 'LAST_DAY'/'LAST_7_DAYS'/'LAST_30_DAYS'/'LAST_90_DAYS'/'LAST_180_DAYS' or integer 1/2/3/4/5 -- constants are preferred -- or for custom range provide an array [from, to] each date in the form yyyy-mm-dd .
1017
+ dateRange: 'LAST_7_DAYS',
1018
+
1019
+ // `mimeTypes`: An Array of strings, acceptable values any/all of the following ['IMAGE', 'VIDEO', 'AUDIO', 'DOCUMENT', 'ARCHIVE'] or ['image', 'video', 'audio', 'application', 'application/zip, application/x-zip-compressed, application/vnd.rar, application/x-rar-compressed'] -- constants are preferred --.
1020
+ mimeTypes: ['IMAGE', 'VIDEO'],
1021
+
1022
+ // `fileTypes`: An Array of strings, acceptable values are provided from BE filters API value property found in file type objects, ex. ['img|x-icon', 'img|jpeg'].
1023
+ fileTypes: ['img|png', 'img|jpeg'],
1024
+
1025
+ // `size`: An Array of integers (only 2), values provided are considered as MB. [minMB, maxMB].
1026
+ size: [0, 10],
1027
+
1028
+ // `tags`: An Array of strings, values are tag sids coming from BE but without (#).
1029
+ tags: ['tge3c9d', 'tgdeaa9'],
1030
+
1031
+ // `imageOrientations`: An Array of strings, any/all of the following values are valid ['PORTRAIT', 'PANORAMA', 'SQUARE', 'LANDSCAPE'] or ['portrait', 'panorama', 'square', 'landscape'] -- constants are preferred --.
1032
+ imageOrientations: ['PORTRAIT', 'SQUARE'],
1033
+
1034
+ // `imageResolutions`: An Array of strings, any/all of the following values are possible ['SMALL', 'MEDIUM', 'LARGE'] or ['small', 'medium', 'large'] -- constants are preferred --.
1035
+ imageResolutions: ['MEDIUM', 'LARGE'],
1036
+
1037
+ // `imageFaces`: An Array of strings, any/all of the following values are possible ['NO_FACES', 'ONE_FACE', 'TWO_FACES', 'ANY'] or ['0', '1', '2', '*'] -- constants(capitalized) are preferred -- (* => means group/multiple of faces).
1038
+ imageFaces: ['1', '*'],
1039
+
1040
+ // `imageMainColors`: An Array of strings, represents the color stringy value it must be any/all of the following only no other colors ['PURPLE', 'RED', 'ORANGE', 'PINK', 'GRASS_GREEN', 'YELLOW', 'AZURE', 'CHARTREUSE', 'TEAL'] or ['purple', 'red', 'orange', 'pink', 'grass_green', 'yellow', 'azure', 'chartreuse', 'teal'] -- constants(capitalized) are preferred --.
1041
+ imageMainColors: ['TEAL', 'YELLOW'],
1042
+
1043
+ // `imageDominantColors`: An Array of strings, represents the color stringy value it must be any/all of the following only no other colors ['PURPLE', 'RED', 'ORANGE', 'PINK', 'GRASS_GREEN', 'YELLOW', 'AZURE', 'CHARTREUSE', 'TEAL'] or ['purple', 'red', 'orange', 'pink', 'grass_green', 'yellow', 'azure', 'chartreuse', 'teal'] -- constants(capitalized) are preferred --.
1044
+ imageDominantColors: ['pink', 'red'],
1045
+
1046
+ // `metadata`: An Array of objects contains { key, condition, value, extraCondition, extraValue }, key and value are required for all metadata types, condition is for changing the operator used while assigning the metadata key to the value in the request, extraCondition is used when u have another condition shows up for the same metadata key/field ex. used 'CONTAINS_NOT' condition for multi select metadata field the extraCondition is 'NOT' only for now, the `value` either the api_key or the internal unique value, the conditions are ['IS', 'IS_NOT', 'CONTAINS', 'CONTAINS_NOT'], all conditions must be upper case, also for 'IS' condition we support empty and non empty options to filter all empty/non empty metadata
1047
+ metadata: [
1048
+ { key: 'cities', value: ['@itm_v1_08bbe7e5_4@', '@itm_v1_905066ed_9@'] },
1049
+ { key: 'brand', value: 'adidas' },
1050
+ { key: 'color', condition: 'IS', value: 'yellow' },
1051
+ { key: 'file', condition: 'CONTAINS_NOT', value: 'png', extraCondition: 'NOT', extraValue: 'jpg' },
1052
+ ],
1053
+
1054
+ // `labels`: An Array of strings, currently accepts 1 label only and the value should be label sid **with** (#).
1055
+ labels: ['#lbbp8dnyu'],
1056
+
1057
+ // `folders`: An Array of strings, currently accepts 1 folder path only.
1058
+ folders: ['/hello-world'],
1059
+
1060
+ // possible values: 'empty' | 'non-empty' | 'specific' (Specific date) | 'range' (Range of 2 dates) | ['', -1] (Before today) | [0] (today) | [1, ''] (After today) | [0, 2] (Within 7 days) | [0, 3] (Within 30 days)
1061
+ licenseExpiry: { value: [1, ''], operator: ':' }
1062
+ }
1063
+ ```
1064
+
1065
+ ```js
1066
+ // filter with operator syntax example
1067
+ {
1068
+ [property]: {
1069
+ value: '...', // required, depends on the filter its type is provided
1070
+ operator: ':' // optional, if needed otherwise the default one is used ':'
1071
+ key: '...', // optional, if needed.
1072
+ }
1073
+ }
1074
+ ```
1075
+
1076
+ > Note: Constant values are better to be used as they are less prone for changes.
1077
+
1078
+ > Note: To lock any of the above properties by using `disabledFiltersAndSearch` or `forceFilters` then you have to provide a value for the property to be locked.
1079
+
1080
+ > Note: Operators are allowed to be provided for all the above filters but some of them are not supported on BE.
1081
+
1082
+ ### `search` ![asset-picker-supported] ![asset-manager-supported]
1083
+
1084
+ <u>Type:</u> `object`.
1085
+
1086
+ <u>Default:</u> `{}`
1087
+
1088
+ Search object to be considered in the views have searching enabled and will be locked if `disableFiltersAndSearch` is `true`, consists of the following:
1089
+
1090
+ | Property | Type | Default | Description |
1091
+ | ------------- | ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1092
+ | **`query`** | `string` | `undefined` | The search query string shown in the search input and used in searching, if using with `disabledFiltersAndSearch` then the property must contain a stringy value to lock the search or at least empty text `''` |
1093
+ | **`tags`** | `string[]` | `undefined` | The search tags found in the search input as advanced search prefxed with symbol (#) -- different from tags of filters -- |
1094
+ | **`filters`** | `string[][]` | `undefined` | The advanced search filters found also in search input by prefixing with the symbol (@) the value consists of array of 2 strings array the first string represents the key, second string represents the value and whole array represents an item -- different from filters --. |
1095
+
1096
+ ```js
1097
+ {
1098
+ // `query`: A string search query shown in the search input.
1099
+ query: '',
1100
+
1101
+ // `tags`: An array of strings **contains** (#). The search input's tags used as advanced search on writing inside the input starting with (#) symbol and spaced tags are surrounded with double quote "" .
1102
+ tags: ['#Cairo', '"#Las Vegas"'],
1103
+
1104
+ // `filters`: An Array of array consists of 2 strings, the 1st string refers to the filter's key and 2nd refers to the filter's value. The search input's filters used as advanced search on writing inside the input starting with (@) symbol.
1105
+ filters: [["key", "value"], ["filename", "Test file"]]
1106
+ }
1107
+ ```
1108
+
1109
+ > Note: To lock any of the above properties by using `disabledFiltersAndSearch` then you have to provide a value for the property to be locked at least empty value would be fine.
1110
+
1111
+ ### `disableFiltersAndSearch` ![asset-picker-supported] ![asset-manager-supported]
1112
+
1113
+ <u>Type:</u> `boolean`.
1114
+
1115
+ <u>Default:</u> `false`
1116
+
1117
+ If `true` then the only provided `filters` & `search` objects will be used as filters & search and disable both the filters & search input in UI dis-allowing the user to change/un-select any of them at all keeping the selected/provided filters not disabled but no changes possible for them.
1118
+
1119
+ > Note: if search query is empty it won't be disabled if you need to disable it with no text provide an empty string `''`.
1120
+
1121
+ > Note: Enabling this option will dismiss applying the filters & search from the url queries.
1122
+
1123
+ ### `forceFilters` ![asset-picker-supported] ![asset-manager-supported]
1124
+
1125
+ If `true` then the provided `filters` will always get applied with no possibility to remove from the UI, but the user still has the option to extend with more filters from the UI unless the provided filter accepts 1 value only.
1126
+
1127
+ > Note: Enabling this option will dismiss applying the filters from the url queries.
1128
+
1129
+ ### `disableFileResolutionFallback` ![asset-picker-supported] ![asset-manager-supported]
1130
+
1131
+ <u>Type:</u> `boolean`.
1132
+
1133
+ <u>Default:</u> `false`
1134
+
1135
+ If `true` it will disable fallback request to load resolution info if not found in file details in grid/list layout.
1136
+
1137
+ ### `hideLeftSideBar` ![asset-picker-supported] ![asset-manager-supported]
1138
+
1139
+ <u>Type:</u> `boolean`.
1140
+
1141
+ <u>Default:</u> `false`
1142
+
1143
+ Hide the folders tree sidebar and its toggle icon.
1144
+
1145
+ ### `defaultFieldKeyOfBulkEditPanel`![uploader-supported] ![asset-manager-supported]
1146
+
1147
+ <u>Type:</u> `string`.
1148
+
1149
+ <u>Default:</u> `'tags'` fallbacks to `'title'`
1150
+
1151
+ Assigns the default field of the bulk edit panel to be opened on showing the bulk edit panel as the focused/default field, it should be one of the general field keys (`tags`/`title`/`description`) or any field key -- lowered case -- of the shown file custom metadata fields (depends on the token).
1152
+
1153
+ ### `enableAIDescription` ![asset-manager-supported]
1154
+
1155
+ <u>Type:</u> `boolean`.
1156
+
1157
+ <u>Default:</u> `false`
1158
+
1159
+ Enables the generate description by AI in the description input of file window.
1160
+
1161
+ ### `hideVariationsTab` ![asset-manager-supported]
1162
+
1163
+ <u>Type:</u> `boolean`.
1164
+
1165
+ <u>Default:</u> `false`
1166
+
1167
+ If `true` force hides the variations tab in file window panel.
1168
+
1169
+ ### `hideMetadataTab` ![asset-manager-supported]
1170
+
1171
+ <u>Type:</u> `boolean`.
1172
+
1173
+ <u>Default:</u> `false`
1174
+
1175
+ If `true` force hides the metadata tab in file window panel.
1176
+
1177
+ ### `hideFileSpecsMetadataFields` ![uploader-supported] ![asset-picker-supported] ![asset-manager-supported]
1178
+
1179
+ <u>Type:</u> `boolean`.
1180
+
1181
+ <u>Default:</u> `false`
1182
+
1183
+ Hides the metadata specs fields for the file on opening in the file window or details/info sidebar for the file (such as, labels, colors, logo and brand...etc.).
1184
+
1185
+ ### `variationsHideManualSubTab` ![asset-manager-supported]
1186
+
1187
+ <u>Type:</u> `boolean`.
1188
+
1189
+ <u>Default:</u> `false`
1190
+
1191
+ If `true` force hides the manual sub-tab of variations tab in file window.
1192
+
1193
+ ### `variationsShowAddPresetButton` ![asset-manager-supported]
1194
+
1195
+ <u>Type:</u> `boolean`.
1196
+
1197
+ <u>Default:</u> `false`
1198
+
1199
+ If `true` shows the add preset button inside the automatic tab if the user allowed to add.
1200
+
1201
+ ### `hideTopBarAddFolderButton` ![asset-manager-supported]
1202
+
1203
+ <u>Type:</u> `boolean`.
1204
+
1205
+ <u>Default:</u> `false`
1206
+
1207
+ If `true` hides the add folder button on the topright.
1208
+
1209
+ ## Events
1210
+
1211
+ The explorer plugin emits different events that you could subscribe to or add your handler to be called with the provided arguments passed while emitting/firing the event, the events are listed below with examples show the parameters for handler:
1212
+
1213
+ ### `objects-removed` ![asset-manager-supported]
1214
+
1215
+ Emitted when objects (folders/labels/files) have been removed from the user's side.
1216
+
1217
+ `params`:
1218
+
1219
+ - `removedObjectsUuids`: An array of removed objects' uuids (for labels the sids will be the value).
1220
+ - `removedObjectsType`: `folders`/`labels`/`files`/`items` (files + folders).
1221
+
1222
+ example
1223
+
1224
+ ```js
1225
+ scaleflexWidget.on("objects-removed", (removedObjectsUuids = [], objectsType) => {
1226
+ console.log(
1227
+ "Objects with the following Uuids have been removed:",
1228
+ removedObjectsUuids,
1229
+ objectsType
1230
+ );
1231
+ });
1232
+ ```
1233
+
1234
+ ### `folders-moved` ![asset-manager-supported]
1235
+
1236
+ Emitted when folder(s) are moved from path to another.
1237
+
1238
+ `params`:
1239
+
1240
+ - `movedFoldersUuids`: An array of folders uuids that are moved.
1241
+ - `newPath`: A string of the new path which the folders moved to.
1242
+
1243
+ example
1244
+
1245
+ ```js
1246
+ scaleflexWidget.on('objects-removed', (movedFoldersUuids = [], newPath) => {
1247
+ console.log(`Following folders uuids ${movedFoldersUuids.join(,)} are moved to this new path (${newPath}).`)
1248
+ })
1249
+ ```
1250
+
1251
+ <!-- Variables -->
1252
+
1253
+ [npm-url]: https://www.npmjs.com/package/@scaleflex/widget-explorer
1254
+ [license-url]: https://opensource.org/licenses/MIT
1255
+ [sfx-url]: https://www.scaleflex.com/
1256
+ [version-url]: https://www.npmjs.com/package/@scaleflex/widget-explorer
1257
+ [codeSandbox-url]: https://codesandbox.io/p/sandbox/scalelfex-widget-v4-sandbox-dtp6l3?file=%2Fsrc%2Findex.js
1258
+ [npm-image]: https://img.shields.io/npm/v/@telus/remark-config.svg?style=for-the-badge&logo=npm
1259
+ [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge
1260
+ [made-by-image]: https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg?style=for-the-badge
1261
+ [plugins-image]: https://img.shields.io/static/v1?label=Scaleflex&message=Plugins&color=yellow&style=for-the-badge
1262
+ [filerobot-image]: https://img.shields.io/static/v1?label=Scaleflex&message=website&color=orange&style=for-the-badge
1263
+ [filerobot-version]: https://img.shields.io/npm/v/@scaleflex/widget-explorer?label=Version&style=for-the-badge&logo=npm
1264
+ [codeSandbox-image]: https://img.shields.io/badge/CodeSandbox-black?style=for-the-badge&logo=CodeSandbox
1265
+ <!-- Supported modes variables -->
1266
+ [uploader-supported]: https://img.shields.io/badge/Uploader-orange
1267
+ [asset-picker-supported]: https://img.shields.io/badge/Asset%20Picker-green
1236
1268
  [asset-manager-supported]: https://img.shields.io/badge/Asset%20Manager-blue