@scaleflex/widget-explorer 0.3.0 → 4.0.2

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 CHANGED
@@ -3,17 +3,52 @@
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.3.0](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.2.1...v0.3.0) (2025-08-12)
6
+ ## [4.0.2](https://code.scaleflex.cloud/scaleflex/widget/compare/v4.0.0...v4.0.2) (2025-08-26)
7
7
 
8
8
 
9
- ### Features
9
+ ### Bug Fixes
10
10
 
11
- * add closeAfterUploadStart option to modal behavior and update documentation ([f9d8afc](https://code.scaleflex.cloud/scaleflex/widget/commits/f9d8afc95f6d848de0d197680e3dbc97c82aca48))
11
+ * update output filename for Scaleflex widget CSS and adjust CDN links for consistency across various components ([244813e](https://code.scaleflex.cloud/scaleflex/widget/commits/244813e3100c606995ec8988484cf7697398f062))
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
+ ## [4.0.1](https://code.scaleflex.cloud/scaleflex/widget/compare/v4.0.0...v4.0.1) (2025-08-26)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update output filename for Scaleflex widget CSS and adjust CDN links for consistency across various components ([244813e](https://code.scaleflex.cloud/scaleflex/widget/commits/244813e3100c606995ec8988484cf7697398f062))
23
+
24
+
25
+
26
+
27
+
28
+
29
+ # [4.0.0](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.3.0...v4.0.0) (2025-08-26)
30
+
31
+
32
+ ### Features
33
+
34
+ * 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))
35
+
36
+
37
+
38
+
39
+
40
+
41
+ # [0.3.0](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.2.1...v0.3.0) (2025-08-12)
42
+
43
+
44
+ ### Features
45
+
46
+ * add closeAfterUploadStart option to modal behavior and update documentation ([f9d8afc](https://code.scaleflex.cloud/scaleflex/widget/commits/f9d8afc95f6d848de0d197680e3dbc97c82aca48))
47
+
48
+
49
+
50
+
51
+
17
52
 
18
53
  ## [0.2.1](https://code.scaleflex.cloud/scaleflex/widget/compare/v0.2.0...v0.2.1) (2025-08-06)
19
54
 
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://cdn.scaleflex.com/plugins/filerobot-widget/assets/filerobot_widget_logo_with_fire.png?vh=b2ff09" width="140"/>
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`.
@@ -5,12 +5,12 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { useDispatch, useSelector } from 'react-redux';
8
- import { Share, Remove, Link, More } from '@scaleflex/icons';
9
- import { PERMISSIONS, CONTEXTMENU_MODES } from '@scaleflex/widget-utils/lib/constants';
8
+ import { Remove, Link, More } from '@scaleflex/icons';
9
+ import { PERMISSIONS } from '@scaleflex/widget-utils/lib/constants';
10
10
  import getFileDetails from '@scaleflex/widget-utils/lib/getFileDetails';
11
11
  import { isVisibilityPublic as isActualVisibilityPublic } from '@scaleflex/widget-utils/lib/visibility';
12
12
  import { useContextMenu } from '@scaleflex/widget-core/lib/hooks';
13
- import { selectIsUserPermittedToDisplayFile, selectIsUserPermittedToShare } from '@scaleflex/widget-core/lib/slices/user.slice';
13
+ import { selectIsUserPermittedToDisplayFile } from '@scaleflex/widget-core/lib/slices/user.slice';
14
14
  import { TooltipV2 } from '@scaleflex/ui/core';
15
15
  import { useExplorer } from '../../hooks';
16
16
  import DownloadWithExportButton from './DownloadWithExportButton';
@@ -28,7 +28,6 @@ var SelectionMenu = function SelectionMenu() {
28
28
  opts = _useExplorer.opts;
29
29
  var triggerDeleteItemsModal = useDeleteItemsModal();
30
30
  var toggleContextMenu = useContextMenu();
31
- var isUserPermittedToShare = useSelector(selectIsUserPermittedToShare);
32
31
  var selectedFoldersUuids = useSelector(selectSelectedFoldersUuids);
33
32
  var selectedFilesUuids = useSelector(selectSelectedFilesUuids);
34
33
  var firstItem = useSelector(selectFirstSelectedFileOrFolder); // priorty goes to file then folder, even if folder selected after file.
@@ -39,7 +38,6 @@ var SelectionMenu = function SelectionMenu() {
39
38
  var selectedItemsCount = selectedFoldersUuids.length + selectedFilesUuids.length;
40
39
  var disableDownloadButton = opts.disableDownloadButton,
41
40
  noImgOperationsAndDownload = opts.noImgOperationsAndDownload,
42
- isFastToken = opts.isFastToken,
43
41
  useAssetsPicker = opts.useAssetsPicker;
44
42
  var copyLinkToClipboard = function copyLinkToClipboard() {
45
43
  dispatch(copyFileCdnLink(firstItem));
@@ -72,22 +70,6 @@ var SelectionMenu = function SelectionMenu() {
72
70
  onClick: copyLinkToClipboard,
73
71
  key: 'get-file'
74
72
  } : null), {
75
- Icon: Share,
76
- onClick: function onClick(event) {
77
- return toggleContextMenu({
78
- event: event,
79
- mode: CONTEXTMENU_MODES.SHARE,
80
- foldersUuids: selectedFoldersUuids,
81
- filesUuids: selectedFilesUuids
82
- });
83
- },
84
- key: 'shareability-file',
85
- disabled: !checkUserPermissions([PERMISSIONS.OBJECTS_SHARE_MANAGE]) || !checkFileFolderPermissions({
86
- permissionsToCheck: [PERMISSIONS.OBJECTS_SHARE_MANAGE],
87
- permissionsList: firstItem === null || firstItem === void 0 ? void 0 : firstItem.permissions
88
- }),
89
- hideOption: !isUserPermittedToShare || isFastToken || isFolderSelected
90
- }, {
91
73
  Icon: Remove,
92
74
  onClick: handelRemoveClick,
93
75
  key: 'remove-file',
@@ -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 { Filerobot } from '@scaleflex/widget-core/lib';
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: Filerobot.uploadFilesData[item.id]
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 Filerobot's static object that has all uploads [File] class instance.
89
- Filerobot.uploadFilesData[item.id] = renamedFileData;
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 { Filerobot } from '@scaleflex/widget-core';
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) && Filerobot.uploadFilesData[file.id] || (file === null || file === void 0 ? void 0 : file.data);
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);
@@ -99,14 +99,19 @@ var VariationsTab = function VariationsTab(_ref) {
99
99
  }, [originalVariants, presets]);
100
100
  var presetsVariants = useMemo(function () {
101
101
  var presetMappedVariants = presets.map(function (preset) {
102
+ // Handle case where preset might be an object with {name, desc} properties
103
+ var presetName = typeof preset === 'string' ? preset : (preset === null || preset === void 0 ? void 0 : preset.name) || (preset === null || preset === void 0 ? void 0 : preset.desc) || 'Unknown';
102
104
  return {
103
- url: "".concat(url, "&p=").concat(preset),
104
- name: preset,
105
+ url: "".concat(url, "&p=").concat(presetName),
106
+ name: presetName,
105
107
  uuid: cuid()
106
108
  };
107
109
  });
108
110
  var bgRemovedVariants = originalVariants.filter(function (variant) {
109
- return variant.bgRemoved && !presets.includes(variant.name);
111
+ return variant.bgRemoved && !presets.some(function (preset) {
112
+ var presetName = typeof preset === 'string' ? preset : (preset === null || preset === void 0 ? void 0 : preset.name) || (preset === null || preset === void 0 ? void 0 : preset.desc);
113
+ return presetName === variant.name;
114
+ });
110
115
  });
111
116
  return [].concat(_toConsumableArray(bgRemovedVariants), _toConsumableArray(presetMappedVariants));
112
117
  }, [url, presets, originalVariants]);
@@ -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 { selectAppliedFilters, selectIsFiltersActive, updateFilteredFiles } from '../../../slices/filters.slice';
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)), moreOptionsShown && /*#__PURE__*/_jsx(Styled.MoreOptionsIconButton, {
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
@@ -1296,7 +1296,6 @@ var Explorer = /*#__PURE__*/function (_Plugin) {
1296
1296
  filesIds: []
1297
1297
  },
1298
1298
  config: {
1299
- companyName: 'scaleflex',
1300
1299
  foldersLimit: 200,
1301
1300
  filesLimit: 50,
1302
1301
  rootFolderPath: '/',
@@ -353,7 +353,6 @@ export var downloadItems = createThunk(async function (_ref14, thunkApi) {
353
353
  }
354
354
  var folderIdentifiers = foldersPaths || [];
355
355
  var fileIdentifiers = filesPaths || [];
356
- console.log('items', items, filesPaths);
357
356
  items.forEach(function (item) {
358
357
  (isFolder(item) ? folderIdentifiers : fileIdentifiers).push(item.uuid);
359
358
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/widget-explorer",
3
- "version": "0.3.0",
3
+ "version": "4.0.2",
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.3.0",
22
- "@scaleflex/widget-icons": "^0.3.0",
23
- "@scaleflex/widget-informer": "^0.3.0",
24
- "@scaleflex/widget-provider-views": "^0.3.0",
25
- "@scaleflex/widget-thumbnail-generator": "^0.3.0",
26
- "@scaleflex/widget-utils": "^0.3.0",
21
+ "@scaleflex/widget-common": "^4.0.2",
22
+ "@scaleflex/widget-icons": "^4.0.2",
23
+ "@scaleflex/widget-informer": "^4.0.2",
24
+ "@scaleflex/widget-provider-views": "^4.0.2",
25
+ "@scaleflex/widget-thumbnail-generator": "^4.0.2",
26
+ "@scaleflex/widget-utils": "^4.0.2",
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": "184ae299a77257f5dfd7e6e645e4003da18a75b4"
54
+ "gitHead": "244f78ed198cf8709905eef721cf02d185f15051"
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;