@scaleflex/widget-explorer 0.3.0 → 4.0.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.
- package/CHANGELOG.md +14 -2
- package/README.md +1 -10
- package/lib/components/FileItem/FileInfo/FileName.js +4 -4
- package/lib/components/FileItem/FileInfo/index.js +2 -2
- package/lib/components/TopBar/Search/index.js +2 -29
- package/lib/index.js +0 -1
- package/package.json +8 -8
- package/types/index.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,18 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [0.
|
|
6
|
+
# [4.0.0](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.3.0...v4.0.0) (2025-08-26)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
-
*
|
|
11
|
+
* update import statements and CDN links for Scaleflex widgets, enhance sandbox functionality, and improve documentation clarity ([6322d8f](https://code.scaleflex.cloud/scaleflex/widget/commits/6322d8f0a1622955f551fa66e38c3a31cc290736))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
# [0.3.0](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.2.1...v0.3.0) (2025-08-12)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add closeAfterUploadStart option to modal behavior and update documentation ([f9d8afc](https://code.scaleflex.cloud/scaleflex/widget/commits/f9d8afc95f6d848de0d197680e3dbc97c82aca48))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
18
30
|
## [0.2.1](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.2.0...v0.2.1) (2025-08-06)
|
|
19
31
|
|
|
20
32
|
**Note:** Version bump only for package @scaleflex/widget-explorer
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[![CodeSandbox][codeSandbox-image]][codeSandbox-url]
|
|
9
9
|
|
|
10
10
|
<div align='center'>
|
|
11
|
-
<img title="Scaleflex Widget logo" alt="Scaleflex Widget logo" src="https://
|
|
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
12
|
</div>
|
|
13
13
|
|
|
14
14
|
The file Explorer and media gallery plugin of the [Scaleflex Media Asset Widget](https://www.npmjs.com/package/@scaleflex/widget-core).
|
|
@@ -140,7 +140,6 @@ The Explorer supports multiple properties to customize the plugin according to y
|
|
|
140
140
|
```js
|
|
141
141
|
{
|
|
142
142
|
config: {
|
|
143
|
-
companyName: 'scaleflex',
|
|
144
143
|
foldersLimit: 200,
|
|
145
144
|
filesLimit: 50,
|
|
146
145
|
rootFolderPath: '/',
|
|
@@ -155,14 +154,6 @@ The Explorer supports multiple properties to customize the plugin according to y
|
|
|
155
154
|
|
|
156
155
|
The config objects contains the main configuration for the plugin to interact with your Scaleflex project:
|
|
157
156
|
|
|
158
|
-
#### `companyName`
|
|
159
|
-
|
|
160
|
-
<u>Type:</u> `string`.
|
|
161
|
-
|
|
162
|
-
<u>Default:</u> `scaleflex`
|
|
163
|
-
|
|
164
|
-
Your company name, used when sharing assets.
|
|
165
|
-
|
|
166
157
|
#### `foldersLimit`
|
|
167
158
|
|
|
168
159
|
<u>Type:</u> `number`.
|
|
@@ -13,7 +13,7 @@ import { uploadUpdated } from '@scaleflex/widget-core/lib/slices/uploads.slice';
|
|
|
13
13
|
import handlePromise from '@scaleflex/widget-utils/lib/handlePromise';
|
|
14
14
|
import isFile from '@scaleflex/widget-utils/lib/isFile';
|
|
15
15
|
import isUploadableFile from '@scaleflex/widget-utils/lib/isUploadableFile';
|
|
16
|
-
import {
|
|
16
|
+
import { ScaleflexWidget } from '@scaleflex/widget-core/lib';
|
|
17
17
|
import extractFileDataNoBlob from '@scaleflex/widget-utils/lib/extractFileDataNoBlob';
|
|
18
18
|
import { itemRenameOpened, selectRenameItemFor } from '../../../slices/panels.slice';
|
|
19
19
|
import { renameFile } from '../../../slices/files.slice';
|
|
@@ -69,7 +69,7 @@ var FileName = function FileName(_ref) {
|
|
|
69
69
|
// Before/Pre upload case, if the file has id property means it's uploadable item.
|
|
70
70
|
if (isPreUpload && isFileType) {
|
|
71
71
|
var newFile = _objectSpread(_objectSpread({}, item), {}, {
|
|
72
|
-
data:
|
|
72
|
+
data: ScaleflexWidget.uploadFilesData[item.id]
|
|
73
73
|
});
|
|
74
74
|
var fileRelativePath = newFile.data.relativePath;
|
|
75
75
|
var renamedFileData = new File([newFile.data], newName, {
|
|
@@ -85,8 +85,8 @@ var FileName = function FileName(_ref) {
|
|
|
85
85
|
}
|
|
86
86
|
dispatch(uploadUpdated(newFile));
|
|
87
87
|
dispatch(itemRenameOpened(null));
|
|
88
|
-
// Updating the file data in
|
|
89
|
-
|
|
88
|
+
// Updating the file data in ScaleflexWidget's static object that has all uploads [File] class instance.
|
|
89
|
+
ScaleflexWidget.uploadFilesData[item.id] = renamedFileData;
|
|
90
90
|
info(i18n('mutualizedRenamedSuccessfullyInfo'), 'success');
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
@@ -19,7 +19,7 @@ import isImage from '@scaleflex/widget-utils/lib/isImage';
|
|
|
19
19
|
import { getVisibilityObject, getFileInheritedVisibility } from '@scaleflex/widget-utils/lib/visibility';
|
|
20
20
|
import { selectUploadsCount } from '@scaleflex/widget-core/lib/slices/uploads.slice';
|
|
21
21
|
import { PC } from '@scaleflex/widget-common';
|
|
22
|
-
import {
|
|
22
|
+
import { ScaleflexWidget } from '@scaleflex/widget-core';
|
|
23
23
|
import isUploadableFile from '@scaleflex/widget-utils/lib/isUploadableFile';
|
|
24
24
|
import FileName from './FileName';
|
|
25
25
|
import Styled from './FileInfo.styled';
|
|
@@ -91,7 +91,7 @@ var FileInfo = function FileInfo(_ref) {
|
|
|
91
91
|
var isResolutionFallbackEnabled = isPreUpload || !disableFileResolutionFallback;
|
|
92
92
|
if (isResolutionFallbackEnabled && !file.isRemote && isImage(file) && !((_file$data = file.data) !== null && _file$data !== void 0 && _file$data.thumbnail) && (!defaultImgWidth || !defaultImgHeight) && (!imgDimensions.width || !imgDimensions.height)) {
|
|
93
93
|
var _file$remote, _file$remote$body;
|
|
94
|
-
var beforeUploadFileData = (file === null || file === void 0 ? void 0 : file.id) &&
|
|
94
|
+
var beforeUploadFileData = (file === null || file === void 0 ? void 0 : file.id) && ScaleflexWidget.uploadFilesData[file.id] || (file === null || file === void 0 ? void 0 : file.data);
|
|
95
95
|
getImgFileDimensions(beforeUploadFileData instanceof File ? beforeUploadFileData : (file === null || file === void 0 ? void 0 : (_file$remote = file.remote) === null || _file$remote === void 0 ? void 0 : (_file$remote$body = _file$remote.body) === null || _file$remote$body === void 0 ? void 0 : _file$remote$body.url) || getFileLink(file)).then(function (imgDimensions) {
|
|
96
96
|
if (cancel) return;
|
|
97
97
|
setImgDimensions(imgDimensions);
|
|
@@ -16,16 +16,14 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
16
16
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
17
|
import { useCallback, useState, useRef, useMemo, useEffect } from 'react';
|
|
18
18
|
import { useDispatch, useSelector } from 'react-redux';
|
|
19
|
-
import { More } from '@scaleflex/icons';
|
|
20
19
|
import { SearchGroup } from '@scaleflex/widget-common';
|
|
21
20
|
import { PERMISSION_MODELS } from '@scaleflex/widget-utils/lib/constants';
|
|
22
21
|
import { checkIsFilterThere } from './Search.utils';
|
|
23
22
|
import ContextDropdown from './ContextDropdown';
|
|
24
|
-
import Styled from '../TopBar.styled';
|
|
25
23
|
import { useExplorer, useSearchSuggestions } from '../../../hooks';
|
|
26
24
|
import { selectSearchSuggestionsTags, updateSearchSuggestions, selectSearchSuggestionsFilters, searchSending, selectDefaultSearchQuery, selectIsSendingSearch, selectSearchQuery, selectSearchSuggestionsAttributesTags, updateSearchQuery, searchSimilarToggled, selectIsSimilarSearchActive, selectIsAiSearch } from '../../../slices/search.slice';
|
|
27
25
|
import { selectionsCleared } from '../../../slices/selections.slice';
|
|
28
|
-
import {
|
|
26
|
+
import { selectIsFiltersActive, updateFilteredFiles } from '../../../slices/filters.slice';
|
|
29
27
|
import { searchOrListViewFiles, selectIsAssetsView } from '../../../slices/views.slice';
|
|
30
28
|
import { fetchInitialFiles, selectIsSearchOrFilesLoading } from '../../../slices/files.slice';
|
|
31
29
|
import { MODE_CHAR, MODE_ID } from '../../../utils/SearchSuggestions/constants';
|
|
@@ -42,7 +40,6 @@ var Search = function Search(_ref) {
|
|
|
42
40
|
var _useExplorer = useExplorer(),
|
|
43
41
|
i18n = _useExplorer.i18n,
|
|
44
42
|
opts = _useExplorer.opts;
|
|
45
|
-
var appliedFilters = useSelector(selectAppliedFilters);
|
|
46
43
|
var searchQuery = useSelector(selectSearchQuery);
|
|
47
44
|
var defaultSearchQuery = useSelector(selectDefaultSearchQuery);
|
|
48
45
|
var isFiltersActive = useSelector(selectIsFiltersActive);
|
|
@@ -70,13 +67,8 @@ var Search = function Search(_ref) {
|
|
|
70
67
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
68
|
searchQueryState = _useState6[0],
|
|
72
69
|
setSearchQueryState = _useState6[1];
|
|
73
|
-
var _useState7 = useState(),
|
|
74
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
75
|
-
moreOptionsMenuAnchor = _useState8[0],
|
|
76
|
-
setMoreOptionsMenuAnchor = _useState8[1];
|
|
77
70
|
var searchInputRef = useRef();
|
|
78
71
|
var containerRef = useRef();
|
|
79
|
-
var menuRef = useRef(null);
|
|
80
72
|
var _useSearchSuggestions = useSearchSuggestions({
|
|
81
73
|
searchContainerRef: containerRef,
|
|
82
74
|
searchInputFocused: searchInputFocused,
|
|
@@ -92,18 +84,12 @@ var Search = function Search(_ref) {
|
|
|
92
84
|
return mode === MODE_ID.TAG;
|
|
93
85
|
}, [mode]);
|
|
94
86
|
var defaultFilters = opts.defaultFilters,
|
|
95
|
-
useAssetsPicker = opts.useAssetsPicker,
|
|
96
87
|
disableFiltersAndSearch = opts.disableFiltersAndSearch,
|
|
97
88
|
forceFilters = opts.forceFilters,
|
|
98
89
|
_opts$search = opts.search,
|
|
99
90
|
search = _opts$search === void 0 ? {} : _opts$search,
|
|
100
91
|
enableAIEmbed = opts.enableAIEmbed;
|
|
101
92
|
var searchInput = searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current;
|
|
102
|
-
var searchFilters = appliedFilters && Object.values(appliedFilters);
|
|
103
|
-
var isSearchInputHasFilters = (searchFilters === null || searchFilters === void 0 ? void 0 : searchFilters.length) > 0 && !(searchFilters !== null && searchFilters !== void 0 && searchFilters.every(function (element) {
|
|
104
|
-
return element === undefined;
|
|
105
|
-
}));
|
|
106
|
-
var moreOptionsShown = (searchQuery || isSearchInputHasFilters) && !useAssetsPicker;
|
|
107
93
|
var showAiSwitcher = enableAIEmbed && permissionModel === PERMISSION_MODELS.PT_ADVANCED && !isSimilarSearchActive;
|
|
108
94
|
var aiSearchDisabled = !isSimilarSearchActive && !(isAiSearchActive && isAssetsView);
|
|
109
95
|
var handleUpdateFilters = function handleUpdateFilters(updatedFilters) {
|
|
@@ -118,10 +104,6 @@ var Search = function Search(_ref) {
|
|
|
118
104
|
handleSearchClearing();
|
|
119
105
|
}
|
|
120
106
|
}, []);
|
|
121
|
-
var toggleMoreOptionsMenu = function toggleMoreOptionsMenu(event) {
|
|
122
|
-
event.stopPropagation();
|
|
123
|
-
setMoreOptionsMenuAnchor(moreOptionsMenuAnchor ? null : menuRef.current);
|
|
124
|
-
};
|
|
125
107
|
var clearSelection = function clearSelection() {
|
|
126
108
|
dispatch(selectionsCleared());
|
|
127
109
|
};
|
|
@@ -263,16 +245,7 @@ var Search = function Search(_ref) {
|
|
|
263
245
|
disableDefaultKeyPressHandler: Boolean(mode) && !isTagModeOn,
|
|
264
246
|
isSendingSearch: isSendingSearch,
|
|
265
247
|
toggleSendingSearch: toggleSendingSearch
|
|
266
|
-
}, searchGroupProps)),
|
|
267
|
-
color: "basic",
|
|
268
|
-
onClick: toggleMoreOptionsMenu,
|
|
269
|
-
ref: menuRef,
|
|
270
|
-
children: function children(iconProps) {
|
|
271
|
-
return /*#__PURE__*/_jsx(More, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
272
|
-
size: 16
|
|
273
|
-
}));
|
|
274
|
-
}
|
|
275
|
-
}), !(isAiSearchActive && isAssetsView) && SuggestionsMenu]
|
|
248
|
+
}, searchGroupProps)), !(isAiSearchActive && isAssetsView) && SuggestionsMenu]
|
|
276
249
|
});
|
|
277
250
|
};
|
|
278
251
|
export default Search;
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/widget-explorer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Scaleflex explorer for the files uploaded on filerobot, handling them & upload new files.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"style": "dist/style.min.css",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"@scaleflex/icons": "^3.0.0-beta.11",
|
|
19
19
|
"@scaleflex/react-url-builder": "^0.0.72",
|
|
20
20
|
"@scaleflex/ui": "^3.0.0-beta.11",
|
|
21
|
-
"@scaleflex/widget-common": "^0.
|
|
22
|
-
"@scaleflex/widget-icons": "^0.
|
|
23
|
-
"@scaleflex/widget-informer": "^0.
|
|
24
|
-
"@scaleflex/widget-provider-views": "^0.
|
|
25
|
-
"@scaleflex/widget-thumbnail-generator": "^0.
|
|
26
|
-
"@scaleflex/widget-utils": "^0.
|
|
21
|
+
"@scaleflex/widget-common": "^4.0.0",
|
|
22
|
+
"@scaleflex/widget-icons": "^4.0.0",
|
|
23
|
+
"@scaleflex/widget-informer": "^4.0.0",
|
|
24
|
+
"@scaleflex/widget-provider-views": "^4.0.0",
|
|
25
|
+
"@scaleflex/widget-thumbnail-generator": "^4.0.0",
|
|
26
|
+
"@scaleflex/widget-utils": "^4.0.0",
|
|
27
27
|
"@transloadit/prettier-bytes": "0.1.0",
|
|
28
28
|
"akamai-filerobot-converter": "^0.1.6",
|
|
29
29
|
"classnames": "^2.2.6",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react-konva": ">=19.0.3"
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bf4d9631c2695e70b94092490e4a9800b54b38b7"
|
|
55
55
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -7,14 +7,9 @@ declare module Explorer {
|
|
|
7
7
|
extends Filerobot.PluginOptions,
|
|
8
8
|
CompanionClient.PublicProviderOptions {
|
|
9
9
|
config: {
|
|
10
|
-
companyName?: string;
|
|
11
10
|
foldersLimit?: number;
|
|
12
11
|
filesLimit?: number;
|
|
13
12
|
folderPath?: string;
|
|
14
|
-
akeneo?: {
|
|
15
|
-
enabled?: boolean;
|
|
16
|
-
clientUrl?: string;
|
|
17
|
-
};
|
|
18
13
|
tagging?: {
|
|
19
14
|
enabled?: boolean;
|
|
20
15
|
autoTagging?: boolean;
|